diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index fee8abf7e0..c9e249779d 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -502,7 +502,7 @@ function _doDispatchEvent (owner, event) { } } _cachedArray.length = 0; -}; +} /** * !#en diff --git a/cocos2d/core/components/CCButton.js b/cocos2d/core/components/CCButton.js index 4071a015fe..060e248283 100644 --- a/cocos2d/core/components/CCButton.js +++ b/cocos2d/core/components/CCButton.js @@ -661,14 +661,15 @@ let Button = cc.Class({ _updateDisabledState () { if (this._sprite) { - this._sprite.setState(cc.Sprite.State.NORMAL); - } - if (this.enableAutoGrayEffect && this.transition !== Transition.COLOR) { - if (!(this.transition === Transition.SPRITE && this.disabledSprite)) { - if (this._sprite && !this.interactable) { - this._sprite.setState(cc.Sprite.State.GRAY); + if (this.enableAutoGrayEffect) { + if (!(this.transition === Transition.SPRITE && this.disabledSprite)) { + if (!this.interactable) { + this._sprite.setState(cc.Sprite.State.GRAY); + return; + } } } + this._sprite.setState(cc.Sprite.State.NORMAL); } } });