瀏覽代碼

revert of switchChange event triggered only on falsy skip

Emanuele Marchi 10 年之前
父節點
當前提交
b7e9c8518f
共有 4 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      dist/js/bootstrap-switch.js
  2. 0 0
      dist/js/bootstrap-switch.min.js
  3. 1 1
      src/coffee/bootstrap-switch.coffee
  4. 1 1
      test/bootstrap-switch.js

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

@@ -493,8 +493,8 @@
                 if (_this.$element.is(":radio")) {
                   $("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
                 }
+                return _this.$element.trigger("switchChange.bootstrapSwitch", [state]);
               }
-              return _this.$element.trigger("switchChange.bootstrapSwitch", [state]);
             };
           })(this),
           "focus.bootstrapSwitch": (function(_this) {

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


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

@@ -369,7 +369,7 @@ do ($ = window.jQuery, window) ->
               .prop("checked", false)
               .trigger "change.bootstrapSwitch", true
 
-          @$element.trigger "switchChange.bootstrapSwitch", [state]
+            @$element.trigger "switchChange.bootstrapSwitch", [state]
 
         "focus.bootstrapSwitch": (e) =>
           e.preventDefault()

+ 1 - 1
test/bootstrap-switch.js

@@ -493,8 +493,8 @@
                 if (_this.$element.is(":radio")) {
                   $("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
                 }
+                return _this.$element.trigger("switchChange.bootstrapSwitch", [state]);
               }
-              return _this.$element.trigger("switchChange.bootstrapSwitch", [state]);
             };
           })(this),
           "focus.bootstrapSwitch": (function(_this) {

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