ソースを参照

Bugfix: https://github.com/nostalgiaz/bootstrap-switch/issues/102

Change

var changeStatus = function ($this) {
  $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');

};

to

var changeStatus = function ($this) {
  if ($element.parent('label').is('.label-change-switch')) {

  } else {
    $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
  }
};

This fixed the bug: https://github.com/nostalgiaz/bootstrap-switch/issues/102
Stein, Peter 11 年 前
コミット
3f6f676d03
1 ファイル変更5 行追加1 行削除
  1. 5 1
      static/js/bootstrap-switch.js

+ 5 - 1
static/js/bootstrap-switch.js

@@ -104,7 +104,11 @@
               $(this).addClass('deactivate');
 
             var changeStatus = function ($this) {
-              $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
+              if ($element.parent('label').is('.label-change-switch')) {
+
+              } else {
+                $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
+              }
             };
 
             $element.on('keydown', function (e) {