浏览代码

substituted unbind in favor of off

Emanuele Marchi 11 年之前
父节点
当前提交
70af6de4bb
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 2 2
      build/js/bootstrap-switch.js
  2. 0 0
      build/js/bootstrap-switch.min.js
  3. 3 3
      src/coffee/bootstrap-switch.coffee

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

@@ -373,9 +373,9 @@
           $div = $element.parent();
           $form = $div.closest("form");
           $div.children().not($element).remove();
-          $element.unwrap().unwrap().unbind("change");
+          $element.unwrap().unwrap().off("change");
           if ($form.length) {
-            $form.unbind("reset").removeData("bootstrap-switch");
+            $form.off("reset").removeData("bootstrap-switch");
           }
           return $element;
         }

文件差异内容过多而无法显示
+ 0 - 0
build/js/bootstrap-switch.min.js


+ 3 - 3
src/coffee/bootstrap-switch.coffee

@@ -39,7 +39,7 @@
           )
           $form = $element.closest("form")
           changeState = ->
-            return if $label.hasClass("label-change-switch")
+            return if $label.hasClass "label-change-switch"
 
             $label
             .trigger("mousedown")
@@ -328,8 +328,8 @@
         $form = $div.closest("form")
 
         $div.children().not($element).remove()
-        $element.unwrap().unwrap().unbind "change"
-        $form.unbind("reset").removeData "bootstrap-switch" if $form.length
+        $element.unwrap().unwrap().off "change"
+        $form.off("reset").removeData "bootstrap-switch" if $form.length
         $element
 
     return methods[method].apply(@, Array::slice.call(arguments, 1)) if methods[method]

部分文件因为文件数量过多而无法显示