Selaa lähdekoodia

transition tweaks

Evan You 11 vuotta sitten
vanhempi
commit
374dcb616c
2 muutettua tiedostoa jossa 12 lisäystä ja 11 poistoa
  1. 11 10
      src/transition/index.js
  2. 1 1
      src/util/env.js

+ 11 - 10
src/transition/index.js

@@ -81,17 +81,18 @@ var apply = exports.apply = function (el, direction, op, vm) {
     op()
     vm._callHook(direction > 0 ? 'attached' : 'detached')
   }
-  // if the vm is being manipulated by a parent directive
-  // during the parent's compilation phase, we skip the
-  // animation.
-  if (vm.$parent && !vm.$parent._isCompiled) {
-    applyOp()
-    return
+  var transData = el.__v_trans
+  if (
+    !transData ||
+    // if the vm is being manipulated by a parent directive
+    // during the parent's compilation phase, skip the
+    // animation.
+    (vm.$parent && !vm.$parent._isCompiled)
+  ) {
+    return applyOp()
   }
   // determine the transition type on the element
-  var transData = el.__v_trans
-  var registry = vm.$options.transitions
-  var jsTransition = transData && registry[transData.id]
+  var jsTransition = vm.$options.transitions[transData.id]
   if (jsTransition) {
     // js
     applyJSTransition(
@@ -101,7 +102,7 @@ var apply = exports.apply = function (el, direction, op, vm) {
       transData,
       jsTransition
     )
-  } else if (transData && _.transitionEndEvent) {
+  } else if (_.transitionEndEvent) {
     // css
     applyCSSTransition(
       el,

+ 1 - 1
src/util/env.js

@@ -44,7 +44,7 @@ exports.isIE9 =
  * Sniff transition/animation events
  */
 
-if (inBrowser) {
+if (inBrowser && !exports.isIE9) {
   if (
     window.ontransitionend === undefined &&
     window.onwebkittransitionend !== undefined