浏览代码

fixed missing container resize on handleWidth and labelWidth programmatic call

Emanuele Marchi 10 年之前
父节点
当前提交
01ba92b351
共有 4 个文件被更改,包括 6 次插入0 次删除
  1. 2 0
      dist/js/bootstrap-switch.js
  2. 0 0
      dist/js/bootstrap-switch.min.js
  3. 2 0
      src/coffee/bootstrap-switch.coffee
  4. 2 0
      test/bootstrap-switch.js

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

@@ -342,6 +342,7 @@
         }
         this.options.handleWidth = value;
         this._width();
+        this._containerPosition();
         return this.$element;
       };
 
@@ -351,6 +352,7 @@
         }
         this.options.labelWidth = value;
         this._width();
+        this._containerPosition();
         return this.$element;
       };
 

文件差异内容过多而无法显示
+ 0 - 0
dist/js/bootstrap-switch.min.js


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

@@ -259,6 +259,7 @@ do ($ = window.jQuery, window) ->
 
       @options.handleWidth = value
       @_width()
+      @_containerPosition()
       @$element
 
     labelWidth: (value) ->
@@ -266,6 +267,7 @@ do ($ = window.jQuery, window) ->
 
       @options.labelWidth = value
       @_width()
+      @_containerPosition()
       @$element
 
     baseClass: (value) ->

+ 2 - 0
test/bootstrap-switch.js

@@ -342,6 +342,7 @@
         }
         this.options.handleWidth = value;
         this._width();
+        this._containerPosition();
         return this.$element;
       };
 
@@ -351,6 +352,7 @@
         }
         this.options.labelWidth = value;
         this._width();
+        this._containerPosition();
         return this.$element;
       };
 

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