Permalink
Browse files

Events: Unbind scroll events properly

Closes #8451
Fixes #8250
  • Loading branch information...
apsdehal authored and arschmitz committed Jun 22, 2016
1 parent 98dd8e2 commit c0bba0d68b24a2bd40765b8ce3371387543b906e
Showing with 6 additions and 4 deletions.
  1. +6 −4 js/events/scroll.js
View
@@ -59,8 +59,7 @@ $.event.special.scrollstart = {
event.type = originalEventType;
}
// iPhone triggers scroll after a small delay; use touchmove instead
$this.bind( scrollEvent, function( event ) {
var scrollStartHandler = $.event.special.scrollstart.handler = function ( event ) {
if ( !$.event.special.scrollstart.enabled ) {
return;
@@ -74,10 +73,13 @@ $.event.special.scrollstart = {
timer = setTimeout( function() {
trigger( event, false );
}, 50 );
} );
};
// iPhone triggers scroll after a small delay; use touchmove instead
$this.on( scrollEvent, scrollStartHandler );
},
teardown: function() {
$( this ).unbind( scrollEvent );
$( this ).off( scrollEvent, $.event.special.scrollstart.handler );
}
};

0 comments on commit c0bba0d

Please sign in to comment.