Sfoglia il codice sorgente

Added the two volpino fixes

Added https://github.com/volpino/bootstrap-switch/commit/ed50d350e45a3bc8b91d6ba0403deed09107bf73

Added https://github.com/volpino/bootstrap-switch/commit/e887adf1d824a805214f090d598a99ee0b2996e8
Stein, Peter 11 anni fa
parent
commit
3cfeee2b59
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      static/js/bootstrap-switch.js

+ 2 - 2
static/js/bootstrap-switch.js

@@ -42,7 +42,7 @@
 
 
             $element.addClass('has-switch');
             $element.addClass('has-switch');
 
 
-            if ($element.data('on'))
+            if ($element.data('on') !== undefined)
               color = "switch-" + $element.data('on');
               color = "switch-" + $element.data('on');
 
 
             if ($element.data('on-label') !== undefined)
             if ($element.data('on-label') !== undefined)
@@ -64,7 +64,7 @@
               .html(onLabel);
               .html(onLabel);
 
 
             color = '';
             color = '';
-            if ($element.data('off'))
+            if ($element.data('off') !== undefined)
               color = "switch-" + $element.data('off');
               color = "switch-" + $element.data('off');
 
 
             $switchRight = $('<span>')
             $switchRight = $('<span>')