* Apply transitions with an operation callback. * * @param {Element} el * @param {Number} direction * 1: enter * -1: leave * @param {Function} op - the actual DOM operation * @param {Vue} vm * @param {Function} [cb]
(el, direction, op, vm, cb)
| 1088 | */ |
| 1089 | |
| 1090 | function applyTransition(el, direction, op, vm, cb) { |
| 1091 | var transition = el.__v_trans; |
| 1092 | if (!transition || |
| 1093 | // skip if there are no js hooks and CSS transition is |
| 1094 | // not supported |
| 1095 | !transition.hooks && !transitionEndEvent || |
| 1096 | // skip transitions for initial compile |
| 1097 | !vm._isCompiled || |
| 1098 | // if the vm is being manipulated by a parent directive |
| 1099 | // during the parent's compilation phase, skip the |
| 1100 | // animation. |
| 1101 | vm.$parent && !vm.$parent._isCompiled) { |
| 1102 | op(); |
| 1103 | if (cb) cb(); |
| 1104 | return; |
| 1105 | } |
| 1106 | var action = direction > 0 ? 'enter' : 'leave'; |
| 1107 | transition[action](op, cb); |
| 1108 | } |
| 1109 | |
| 1110 | var transition = Object.freeze({ |
| 1111 | appendWithTransition: appendWithTransition, |
no test coverage detected