소스 검색

hotfix: error in case of missing bootstrap transition.js

Emanuele Marchi 10 년 전
부모
커밋
dcc720e19a
4개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 1
      dist/js/bootstrap-switch.js
  2. 0 0
      dist/js/bootstrap-switch.min.js
  3. 6 3
      src/coffee/bootstrap-switch.coffee
  4. 5 1
      test/bootstrap-switch.js

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

@@ -467,7 +467,11 @@
         if (!callback) {
           return;
         }
-        return this.$container.one($.support.transition.end, callback).emulateTransitionEnd(500);
+        if ($.support.transition) {
+          return this.$container.one("bsTransitionEnd", callback).emulateTransitionEnd(500);
+        } else {
+          return callback();
+        }
       };
 
       BootstrapSwitch.prototype._elementHandlers = function() {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/js/bootstrap-switch.min.js


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

@@ -355,9 +355,12 @@ do ($ = window.jQuery, window) ->
 
       return  unless callback
 
-      @$container
-      .one($.support.transition.end, callback)
-      .emulateTransitionEnd 500
+      if $.support.transition
+        @$container
+        .one("bsTransitionEnd", callback)
+        .emulateTransitionEnd 500
+      else
+        callback()
 
     _elementHandlers: ->
       @$element.on

+ 5 - 1
test/bootstrap-switch.js

@@ -467,7 +467,11 @@
         if (!callback) {
           return;
         }
-        return this.$container.one($.support.transition.end, callback).emulateTransitionEnd(500);
+        if ($.support.transition) {
+          return this.$container.one("bsTransitionEnd", callback).emulateTransitionEnd(500);
+        } else {
+          return callback();
+        }
       };
 
       BootstrapSwitch.prototype._elementHandlers = function() {

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.