Skip to content

Commit

Permalink
Fix scrollEnd event from double firing
Browse files Browse the repository at this point in the history
cubiq#761

On wheelscroll the scrollEnd event was firing twice. Once from _transitionEnd (core.js) and once from a timeout in _wheel (wheel.js).

Placed a check in _transitionEnd to only fire scrollEnd event if _wheel's scrollEnd event is already set to execute.
  • Loading branch information
mcountis committed Sep 18, 2014
1 parent 4ef4a80 commit 24ee228
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ IScroll.prototype = {
this._transitionTime();
if ( !this.resetPosition(this.options.bounceTime) ) {
this.isInTransition = false;
this._execEvent('scrollEnd');
if (this.wheelTimeout === undefined) {
this._execEvent('scrollEnd');
}
}
},

Expand Down

0 comments on commit 24ee228

Please sign in to comment.