Przeglądaj źródła

Update bootstrapSwitch.js

updated "in  if ($this.closest('.switch').is('.deactivate'))" to be "in  if ($this.closest('.has-switch').is('.deactivate'))".
because if anyone initialized the plugin to an element that doesn't have switch class and the inner checkbox is disabled, it will be dimmed but still working because it won't find the .switch class in closest selector.
Alaa Ali 12 lat temu
rodzic
commit
669a4005a8
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      static/js/bootstrapSwitch.js

+ 1 - 1
static/js/bootstrapSwitch.js

@@ -139,7 +139,7 @@
 
 
               $this.closest('div').removeClass('switch-animate');
               $this.closest('div').removeClass('switch-animate');
 
 
-              if ($this.closest('.switch').is('.deactivate'))
+              if ($this.closest('.has-switch').is('.deactivate'))
                 $this.unbind('click');
                 $this.unbind('click');
               else {
               else {
                 $this.on('mousemove touchmove', function (e) {
                 $this.on('mousemove touchmove', function (e) {