Преглед на файлове

Made it impossible to uncheck a checked radio button.

George K преди 11 години
родител
ревизия
132ac97afe
променени са 3 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 3 0
      dist/js/bootstrap-switch.js
  2. 0 0
      dist/js/bootstrap-switch.min.js
  3. 1 0
      src/coffee/bootstrap-switch.coffee

+ 3 - 0
dist/js/bootstrap-switch.js

@@ -121,6 +121,9 @@
         if (this.options.disabled || this.options.readonly || this.options.indeterminate) {
         if (this.options.disabled || this.options.readonly || this.options.indeterminate) {
           return this.$element;
           return this.$element;
         }
         }
+        if (this.options.state && this.$element.is(':radio')) {
+          return this.$element;
+        }
         value = !!value;
         value = !!value;
         this.$element.prop("checked", value).trigger("change.bootstrapSwitch", skip);
         this.$element.prop("checked", value).trigger("change.bootstrapSwitch", skip);
         return this.$element;
         return this.$element;

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/js/bootstrap-switch.min.js


+ 1 - 0
src/coffee/bootstrap-switch.coffee

@@ -74,6 +74,7 @@ do ($ = window.jQuery, window) ->
     state: (value, skip) ->
     state: (value, skip) ->
       return @options.state if typeof value is "undefined"
       return @options.state if typeof value is "undefined"
       return @$element if @options.disabled or @options.readonly or @options.indeterminate
       return @$element if @options.disabled or @options.readonly or @options.indeterminate
+      return @$element if @options.state and @$element.is ':radio'
 
 
       value = not not value
       value = not not value
 
 

Някои файлове не бяха показани, защото твърде много файлове са промени