From 7d215761021a0c671e451111fdef61e192e1a7ba Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Wed, 25 May 2016 17:11:19 +0800 Subject: [PATCH] fix a minor bug of scrollview event --- cocos2d/core/components/CCScrollView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/components/CCScrollView.js b/cocos2d/core/components/CCScrollView.js index 2cece50ceb..5a802b1ff3 100644 --- a/cocos2d/core/components/CCScrollView.js +++ b/cocos2d/core/components/CCScrollView.js @@ -783,7 +783,7 @@ var ScrollView = cc.Class({ realMove = cc.pAdd(realMove, outOfBoundary); } - var scrollEventType = ''; + var scrollEventType = -1; if (realMove.y > 0) { //up var icBottomPos = this.content.y - this.content.anchorY * this.content.height; @@ -819,7 +819,7 @@ var ScrollView = cc.Class({ this._dispatchEvent(EventType.SCROLLING); } - if (scrollEventType) { + if (scrollEventType !== -1) { this._dispatchEvent(scrollEventType); }