Skip to content

Commit

Permalink
fix error on adding toggle component (cocos#4296)
Browse files Browse the repository at this point in the history
  • Loading branch information
PPpro authored and jareguo committed Apr 24, 2019
1 parent 069c911 commit 0ccbdd2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cocos2d/core/components/CCToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,10 @@ let Toggle = cc.Class({
_updateDisabledState: function () {
this._super();

let useGrayMaterial = false;
if (this.enableAutoGrayEffect) {
if (this.checkMark && !this.interactable) {
useGrayMaterial = true;
}
if (this.enableAutoGrayEffect && this.checkMark) {
let useGrayMaterial = !this.interactable;
this._switchGrayMaterial(useGrayMaterial, this.checkMark);
}

this._switchGrayMaterial(useGrayMaterial, this.checkMark);
},

_registerToggleEvent: function () {
Expand Down

0 comments on commit 0ccbdd2

Please sign in to comment.