Quellcode durchsuchen

Update to v1.7 and fixed switch class bug

Fixed the problem with the class ".switch" in other plugins:
change ".switch" to ".make-switch"
Update to jQuery 1.9.1
Update to twitter-bootstrap v2.3.2

Update bootstrap-switch to v1.7
Stein, Peter vor 11 Jahren
Ursprung
Commit
4bd8e63a0c
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      static/js/bootstrap-switch.js

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

@@ -1,5 +1,5 @@
 /*! ============================================================
- * bootstrapSwitch v1.6 by Larentis Mattia @SpiritualGuru
+ * bootstrapSwitch v1.7 by Larentis Mattia @SpiritualGuru
  * http://www.larentis.eu/
  * 
  * Enhanced for radiobuttons by Stein, Peter @BdMdesigN
@@ -156,7 +156,7 @@
                 $this.unbind('click');
               } else {
                 $this.on('mousemove touchmove', function (e) {
-                  var $element = $(this).closest('.switch')
+                  var $element = $(this).closest('.make-switch')
                     , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
                     , percent = (relativeX / $element.width()) * 100
                     , left = 25
@@ -216,7 +216,7 @@
             if ($form.data('bootstrapSwitch') !== 'injected') {
               $form.bind('reset', function () {
                 setTimeout(function () {
-                  $form.find('.switch').each(function () {
+                  $form.find('.make-switch').each(function () {
                     var $input = $(this).find(inputSelector);
 
                     $input.prop('checked', $input.is(':checked')).trigger('change');
@@ -305,6 +305,6 @@
 
 (function($) {  // creates scope for $ sign assigned to jQuery
     $(function () { // on dom ready
-        $('.switch')['bootstrapSwitch'](); // attach bootstrapswitch
+        $('.make-switch')['bootstrapSwitch'](); // attach bootstrapswitch
     });
 })(jQuery);