Browse Source

fixed double event triggering if selector is id #317

LostCrew 11 years ago
parent
commit
52c291dd5c

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

@@ -452,6 +452,7 @@
           })(this),
           })(this),
           "click.bootstrapSwitch": (function(_this) {
           "click.bootstrapSwitch": (function(_this) {
             return function(e) {
             return function(e) {
+              e.preventDefault();
               _this.toggleState();
               _this.toggleState();
               return _this.$element.trigger("focus.bootstrapSwitch");
               return _this.$element.trigger("focus.bootstrapSwitch");
             };
             };

File diff suppressed because it is too large
+ 0 - 0
dist/js/bootstrap-switch.min.js


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

@@ -342,6 +342,8 @@ do ($ = window.jQuery, window) ->
           @$label.trigger "mouseup.bootstrapSwitch"
           @$label.trigger "mouseup.bootstrapSwitch"
 
 
         "click.bootstrapSwitch": (e) =>
         "click.bootstrapSwitch": (e) =>
+          e.preventDefault()
+
           @toggleState()
           @toggleState()
           @$element.trigger "focus.bootstrapSwitch"
           @$element.trigger "focus.bootstrapSwitch"
 
 

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