Browse Source

Made it impossible to uncheck a checked radio button.

George K 11 years ago
parent
commit
132ac97afe

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

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

File diff suppressed because it is too large
+ 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) ->
       return @options.state if typeof value is "undefined"
       return @$element if @options.disabled or @options.readonly or @options.indeterminate
+      return @$element if @options.state and @$element.is ':radio'
 
       value = not not value
 

Some files were not shown because too many files changed in this diff