@@ -20,12 +20,6 @@ var endEvents = sniffEndEvents(),
20
20
SKIP : - 6
21
21
}
22
22
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
-
29
23
/**
30
24
* stage:
31
25
* 1 = enter
@@ -83,14 +77,12 @@ function applyTransitionClass (el, stage, changeState, hasAnimation) {
83
77
84
78
// if the browser supports transition,
85
79
// it must have classList...
86
- var onEnd , job ,
80
+ var onEnd ,
87
81
classList = el . classList ,
88
82
existingCallback = el . vue_trans_cb ,
89
83
enterClass = config . enterClass ,
90
84
leaveClass = config . leaveClass ,
91
- endEvent = hasAnimation
92
- ? endEvents . anim
93
- : endEvents . trans
85
+ endEvent = hasAnimation ? endEvents . anim : endEvents . trans
94
86
95
87
// cancel unfinished callbacks and jobs
96
88
if ( existingCallback ) {
@@ -102,18 +94,17 @@ function applyTransitionClass (el, stage, changeState, hasAnimation) {
102
94
103
95
if ( stage > 0 ) { // enter
104
96
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 )
109
99
// append
110
100
changeState ( )
111
- job = { }
112
101
// trigger transition
113
102
if ( ! hasAnimation ) {
114
- job . execute = function ( ) {
115
- classList . remove ( enterClass )
116
- }
103
+ batcher . push ( {
104
+ execute : function ( ) {
105
+ classList . remove ( enterClass )
106
+ }
107
+ } )
117
108
} else {
118
109
onEnd = function ( e ) {
119
110
if ( e . target === el ) {
@@ -122,13 +113,9 @@ function applyTransitionClass (el, stage, changeState, hasAnimation) {
122
113
classList . remove ( enterClass )
123
114
}
124
115
}
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
130
118
}
131
- batcher . push ( job )
132
119
return codes . CSS_E
133
120
134
121
} else { // leave
0 commit comments