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

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

@@ -503,8 +503,8 @@
                 if (_this.$element.is(":radio")) {
                 if (_this.$element.is(":radio")) {
                   $("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
                   $("[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),
           })(this),
           "focus.bootstrapSwitch": (function(_this) {
           "focus.bootstrapSwitch": (function(_this) {
@@ -562,6 +562,7 @@
                 return;
                 return;
               }
               }
               e.preventDefault();
               e.preventDefault();
+              e.stopPropagation();
               _this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css("margin-left"), 10);
               _this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css("margin-left"), 10);
               if (_this.options.animate) {
               if (_this.options.animate) {
                 _this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");
                 _this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");

文件差異過大導致無法顯示
+ 0 - 0
dist/js/bootstrap-switch.min.js


+ 1 - 1
options-3.html

@@ -84,7 +84,7 @@
             <td>size</td>
             <td>size</td>
             <td>data-size</td>
             <td>data-size</td>
             <td>String</td>
             <td>String</td>
-            <td>The checkbox state</td>
+            <td>The checkbox size</td>
             <td>null, 'mini', 'small', 'normal', 'large'</td>
             <td>null, 'mini', 'small', 'normal', 'large'</td>
             <td>null</td>
             <td>null</td>
           </tr>
           </tr>

+ 2 - 1
test/bootstrap-switch.js

@@ -503,8 +503,8 @@
                 if (_this.$element.is(":radio")) {
                 if (_this.$element.is(":radio")) {
                   $("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
                   $("[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),
           })(this),
           "focus.bootstrapSwitch": (function(_this) {
           "focus.bootstrapSwitch": (function(_this) {
@@ -562,6 +562,7 @@
                 return;
                 return;
               }
               }
               e.preventDefault();
               e.preventDefault();
+              e.stopPropagation();
               _this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css("margin-left"), 10);
               _this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css("margin-left"), 10);
               if (_this.options.animate) {
               if (_this.options.animate) {
                 _this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");
                 _this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");

部分文件因文件數量過多而無法顯示