Просмотр исходного кода

allow transition to specify css: false

Evan You 11 лет назад
Родитель
Сommit
54063f409f
1 измененных файлов с 11 добавлено и 6 удалено
  1. 11 6
      src/transition/transition.js

+ 11 - 6
src/transition/transition.js

@@ -245,13 +245,18 @@ p.callHookWithCb = function (type) {
  */
 
 p.getCssTransitionType = function (className) {
-  // skip CSS transitions if page is not visible -
-  // this solves the issue of transitionend events not
-  // firing until the page is visible again.
-  // pageVisibility API is supported in IE10+, same as
-  // CSS transitions.
   /* istanbul ignore if */
-  if (!transitionEndEvent || document.hidden) {
+  if (
+    !transitionEndEvent ||
+    // skip CSS transitions if page is not visible -
+    // this solves the issue of transitionend events not
+    // firing until the page is visible again.
+    // pageVisibility API is supported in IE10+, same as
+    // CSS transitions.
+    document.hidden ||
+    // explicit js-only transition
+    (this.hooks && this.hooks.css === false)
+  ) {
     return
   }
   var type = this.typeCache[className]