From 24ee228becbf7977f71f2d49a13fa2774c1f305e Mon Sep 17 00:00:00 2001 From: Mike Countis Date: Thu, 18 Sep 2014 11:55:31 -0700 Subject: [PATCH] Fix scrollEnd event from double firing https://github.com/cubiq/iscroll/issues/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. --- src/core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.js b/src/core.js index dcfab624..9c1e1d45 100644 --- a/src/core.js +++ b/src/core.js @@ -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'); + } } },