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 102102 * @constructor
103103 */
104104 var ResizeSensor = function ( element , callback ) {
105- var lastAnimationFrame = 0 ;
106-
107105 /**
108106 *
109107 * @constructor
206204 var lastWidth = 0 ;
207205 var lastHeight = 0 ;
208206 var initialHiddenCheck = true ;
209- lastAnimationFrame = 0 ;
207+ var lastAnimationFrame = 0 ;
210208
211209 var resetExpandShrink = function ( ) {
212210 var width = element . offsetWidth ;
283281 addEvent ( shrink , 'scroll' , onScroll ) ;
284282
285283 // Fix for custom Elements
286- lastAnimationFrame = requestAnimationFrame ( reset ) ;
284+ requestAnimationFrame ( reset ) ;
287285 }
288286
289287 forEachElement ( element , function ( elem ) {
290288 attachResizeEvent ( elem , callback ) ;
291289 } ) ;
292290
293291 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- }
299292 ResizeSensor . detach ( element , ev ) ;
300293 } ;
301294
You can’t perform that action at this time.
0 commit comments