File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 102
102
* @constructor
103
103
*/
104
104
var ResizeSensor = function ( element , callback ) {
105
- var lastAnimationFrame = 0 ;
106
-
107
105
/**
108
106
*
109
107
* @constructor
206
204
var lastWidth = 0 ;
207
205
var lastHeight = 0 ;
208
206
var initialHiddenCheck = true ;
209
- lastAnimationFrame = 0 ;
207
+ var lastAnimationFrame = 0 ;
210
208
211
209
var resetExpandShrink = function ( ) {
212
210
var width = element . offsetWidth ;
283
281
addEvent ( shrink , 'scroll' , onScroll ) ;
284
282
285
283
// Fix for custom Elements
286
- lastAnimationFrame = requestAnimationFrame ( reset ) ;
284
+ requestAnimationFrame ( reset ) ;
287
285
}
288
286
289
287
forEachElement ( element , function ( elem ) {
290
288
attachResizeEvent ( elem , callback ) ;
291
289
} ) ;
292
290
293
291
this . detach = function ( ev ) {
294
- // clean up the unfinished animation frame to prevent a potential endless requestAnimationFrame of reset
295
- if ( ! lastAnimationFrame ) {
296
- window . cancelAnimationFrame ( lastAnimationFrame ) ;
297
- lastAnimationFrame = 0 ;
298
- }
299
292
ResizeSensor . detach ( element , ev ) ;
300
293
} ;
301
294
You can’t perform that action at this time.
0 commit comments