diff --git a/cocos2d/core/components/CCButton.js b/cocos2d/core/components/CCButton.js index 90668f4e5e..d2e0b9289c 100644 --- a/cocos2d/core/components/CCButton.js +++ b/cocos2d/core/components/CCButton.js @@ -314,6 +314,7 @@ var Button = cc.Class({ }, _onTouchMove: function (event) { + if (!this.interactable || !this.enabledInHierarchy) return; // mobile phone will not emit _onMouseMoveOut, // so we have to do hit test when touch moving var touch = event.touch; @@ -331,6 +332,8 @@ var Button = cc.Class({ }, _onTouchEnded: function () { + if (!this.interactable || !this.enabledInHierarchy) return; + if (this._pressed) { cc.Component.EventHandler.emitEvents(this.clickEvents); } @@ -339,6 +342,8 @@ var Button = cc.Class({ }, _onTouchCancel: function () { + if (!this.interactable || !this.enabledInHierarchy) return; + this._pressed = false; this._updateState(); }, diff --git a/cocos2d/core/components/CCScrollView.js b/cocos2d/core/components/CCScrollView.js index 700017365e..34ebac6605 100644 --- a/cocos2d/core/components/CCScrollView.js +++ b/cocos2d/core/components/CCScrollView.js @@ -473,8 +473,8 @@ var ScrollView = cc.Class({ if(!this._stopMouseWheel) { this._handlePressLogic(); + this.schedule(this._checkMouseWheel, 0.01); this._stopMouseWheel = true; - this._checkMouseWheel(); } event.stopPropagation(); }, @@ -484,6 +484,7 @@ var ScrollView = cc.Class({ if (!cc.pFuzzyEqual(currentOutOfBoundary, cc.p(0, 0), EPSILON)) { this._processInertiaScroll(); + this.unschedule(this._checkMouseWheel); this._stopMouseWheel = false; } },