@@ -20,12 +20,6 @@ var endEvents = sniffEndEvents(),
2020 SKIP : - 6
2121 }
2222
23- // force a layout so transition can be triggered
24- batcher . _preFlush = function ( ) {
25- /* jshint unused: false */
26- var forceLayout = document . body . clientHeight
27- }
28-
2923/**
3024 * stage:
3125 * 1 = enter
@@ -83,14 +77,12 @@ function applyTransitionClass (el, stage, changeState, hasAnimation) {
8377
8478 // if the browser supports transition,
8579 // it must have classList...
86- var onEnd , job ,
80+ var onEnd ,
8781 classList = el . classList ,
8882 existingCallback = el . vue_trans_cb ,
8983 enterClass = config . enterClass ,
9084 leaveClass = config . leaveClass ,
91- endEvent = hasAnimation
92- ? endEvents . anim
93- : endEvents . trans
85+ endEvent = hasAnimation ? endEvents . anim : endEvents . trans
9486
9587 // cancel unfinished callbacks and jobs
9688 if ( existingCallback ) {
@@ -102,18 +94,17 @@ function applyTransitionClass (el, stage, changeState, hasAnimation) {
10294
10395 if ( stage > 0 ) { // enter
10496
105- // set to hidden state before appending
106- if ( ! hasAnimation ) {
107- classList . add ( enterClass )
108- }
97+ // set to enter state before appending
98+ classList . add ( enterClass )
10999 // append
110100 changeState ( )
111- job = { }
112101 // trigger transition
113102 if ( ! hasAnimation ) {
114- job . execute = function ( ) {
115- classList . remove ( enterClass )
116- }
103+ batcher . push ( {
104+ execute : function ( ) {
105+ classList . remove ( enterClass )
106+ }
107+ } )
117108 } else {
118109 onEnd = function ( e ) {
119110 if ( e . target === el ) {
@@ -122,13 +113,9 @@ function applyTransitionClass (el, stage, changeState, hasAnimation) {
122113 classList . remove ( enterClass )
123114 }
124115 }
125- job . execute = function ( ) {
126- classList . add ( enterClass )
127- el . addEventListener ( endEvent , onEnd )
128- el . vue_trans_cb = onEnd
129- }
116+ el . addEventListener ( endEvent , onEnd )
117+ el . vue_trans_cb = onEnd
130118 }
131- batcher . push ( job )
132119 return codes . CSS_E
133120
134121 } else { // leave
0 commit comments