浏览代码

fixed double event triggering if selector is id #317

LostCrew 11 年之前
父节点
当前提交
52c291dd5c
共有 3 个文件被更改,包括 3 次插入0 次删除
  1. 1 0
      dist/js/bootstrap-switch.js
  2. 0 0
      dist/js/bootstrap-switch.min.js
  3. 2 0
      src/coffee/bootstrap-switch.coffee

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

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

文件差异内容过多而无法显示
+ 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"
 
         "click.bootstrapSwitch": (e) =>
+          e.preventDefault()
+
           @toggleState()
           @$element.trigger "focus.bootstrapSwitch"
 

部分文件因为文件数量过多而无法显示