@@ -166,7 +166,9 @@ export function transition(flags, element, get_fn, get_params) {
166
166
element . inert = inert ;
167
167
168
168
if ( is_intro ) {
169
+ dispatch_event ( element , 'introstart' ) ;
169
170
intro = animate ( element , get_options ( ) , outro , 1 , ( ) => {
171
+ dispatch_event ( element , 'introend' ) ;
170
172
intro = current_options = undefined ;
171
173
} ) ;
172
174
} else {
@@ -178,7 +180,9 @@ export function transition(flags, element, get_fn, get_params) {
178
180
if ( is_outro ) {
179
181
element . inert = true ;
180
182
183
+ dispatch_event ( element , 'outrostart' ) ;
181
184
outro = animate ( element , get_options ( ) , intro , 0 , ( ) => {
185
+ dispatch_event ( element , 'outroend' ) ;
182
186
outro = current_options = undefined ;
183
187
fn ?. ( ) ;
184
188
} ) ;
@@ -258,8 +262,6 @@ function animate(element, options, counterpart, t2, callback) {
258
262
} ;
259
263
}
260
264
261
- dispatch_event ( element , t2 === 1 ? 'introstart' : 'outrostart' ) ; // TODO not for `animate:`
262
-
263
265
var { delay = 0 , duration, css, tick, easing = linear } = options ;
264
266
265
267
var start = raf . now ( ) + delay ;
@@ -296,7 +298,6 @@ function animate(element, options, counterpart, t2, callback) {
296
298
animation . finished
297
299
. then ( ( ) => {
298
300
callback ?. ( ) ;
299
- dispatch_event ( element , t2 === 1 ? 'introend' : 'outroend' ) ;
300
301
} )
301
302
. catch ( noop ) ;
302
303
} else {
@@ -309,7 +310,6 @@ function animate(element, options, counterpart, t2, callback) {
309
310
if ( now >= end ) {
310
311
tick ?. ( t2 , 1 - t2 ) ;
311
312
callback ?. ( ) ;
312
- dispatch_event ( element , t2 === 1 ? 'introend' : 'outroend' ) ;
313
313
return false ;
314
314
}
315
315
0 commit comments