瀏覽代碼

fix(wrapper): incorporate setter and getter in one method to rule them all

One Method to find them,
One Method to bring them all and in the darkness bind them
In the Land of Mordor where the Shadows lie.
Francesco Pontillo 11 年之前
父節點
當前提交
d40525f0cf
共有 4 個文件被更改,包括 7 次插入0 次删除
  1. 2 0
      .gitignore
  2. 3 0
      dist/js/bootstrap-switch.js
  3. 0 0
      dist/js/bootstrap-switch.min.js
  4. 2 0
      src/coffee/bootstrap-switch.coffee

+ 2 - 0
.gitignore

@@ -1,3 +1,5 @@
 .grunt
 .grunt
 node_modules
 node_modules
 components
 components
+.idea/
+bower_components/

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

@@ -268,6 +268,9 @@
         if (typeof value === "undefined") {
         if (typeof value === "undefined") {
           return this.options.wrapperClass;
           return this.options.wrapperClass;
         }
         }
+        if (!value) {
+          value = $.fn.bootstrapSwitch.defaults.wrapperClass;
+        }
         getClasses = (function(_this) {
         getClasses = (function(_this) {
           return function(classes) {
           return function(classes) {
             var c, cls, _i, _len;
             var c, cls, _i, _len;

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


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

@@ -189,6 +189,8 @@ do ($ = window.jQuery, window) ->
     wrapperClass: (value) ->
     wrapperClass: (value) ->
       return @options.wrapperClass if typeof value is "undefined"
       return @options.wrapperClass if typeof value is "undefined"
 
 
+      value = $.fn.bootstrapSwitch.defaults.wrapperClass if !value
+
       getClasses = (classes) =>
       getClasses = (classes) =>
         unless $.isArray classes
         unless $.isArray classes
           return "#{@options.baseClass}-#{classes}"
           return "#{@options.baseClass}-#{classes}"

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