From fbd9d2492aeaef392ad59792825b8757d6c363fc Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 15 Jun 2012 15:14:34 -0700 Subject: Fixing apply 'no color' This should fix canvas and standard DOM elements including the root (body or template wrapper). --- js/panels/color/colorchippopup.reel/colorchippopup.js | 4 ++-- js/panels/color/colorpanelbase.reel/colorpanelbase.js | 18 +++++++++--------- .../color/colorpanelpopup.reel/colorpanelpopup.js | 8 ++++---- js/panels/color/colortoolbar.reel/colortoolbar.js | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'js/panels/color') diff --git a/js/panels/color/colorchippopup.reel/colorchippopup.js b/js/panels/color/colorchippopup.reel/colorchippopup.js index 414be8b7..923beca9 100755 --- a/js/panels/color/colorchippopup.reel/colorchippopup.js +++ b/js/panels/color/colorchippopup.reel/colorchippopup.js @@ -43,8 +43,8 @@ exports.ColorChipPopup = Montage.create(Component, { // setNoColor: { enumerable: true, - value: function (e) { - this.colorManager.applyNoColor(); + value: function (code) { + this.colorManager.applyNoColor(code); } }, //////////////////////////////////////////////////////////////////// diff --git a/js/panels/color/colorpanelbase.reel/colorpanelbase.js b/js/panels/color/colorpanelbase.reel/colorpanelbase.js index 7a28c55d..7071f590 100755 --- a/js/panels/color/colorpanelbase.reel/colorpanelbase.js +++ b/js/panels/color/colorpanelbase.reel/colorpanelbase.js @@ -694,7 +694,7 @@ exports.ColorPanelBase = Montage.create(Component, { case 'nocolor': this._buttons.nocolor.push(button); button.title = 'No Color'; - button.addEventListener('click', this.setNoColor.bind(this)); + button.addEventListener('click', function () {this.setNoColor(false)}.bind(this)); break; //////////////////////////////////////////////////////// case 'swap': @@ -746,7 +746,7 @@ exports.ColorPanelBase = Montage.create(Component, { color.wasSetByCode = false; // if (prev.m === 'nocolor') { - this.setNoColor(); + this.setNoColor(false); } else { this.colorManager.alpha = { value: alpha, wasSetByCode: true, type: 'change' }; this.colorManager[prev.m] = color; @@ -832,11 +832,11 @@ exports.ColorPanelBase = Montage.create(Component, { //TODO: Add set by code property setNoColor: { enumerable: true, - value: function (e) { + value: function (wasSetByCode) { // this.application.ninja.colorController.colorPopupManager.hideColorPopup(); // - this.colorManager.applyNoColor(); + this.colorManager.applyNoColor(wasSetByCode); } }, //////////////////////////////////////////////////////////////////// @@ -879,7 +879,7 @@ exports.ColorPanelBase = Montage.create(Component, { break; //////////////////////////////////////////////////////// default: - this.setNoColor(); + this.setNoColor(false); break; //////////////////////////////////////////////////////// } @@ -911,7 +911,7 @@ exports.ColorPanelBase = Montage.create(Component, { break; //////////////////////////////////////////////////////// default: - this.setNoColor(); + this.setNoColor(false); break; //////////////////////////////////////////////////////// } @@ -1300,7 +1300,7 @@ exports.ColorPanelBase = Montage.create(Component, { update.type = 'change'; this.colorManager.hsl = update; } else { - this.colorManager.applyNoColor(); + this.colorManager.applyNoColor(false); } } else { update = this.colorManager.hexToRgb(color); @@ -1309,7 +1309,7 @@ exports.ColorPanelBase = Montage.create(Component, { update.type = 'change'; this.colorManager.rgb = update; } else { - this.colorManager.applyNoColor(); + this.colorManager.applyNoColor(false); } } } @@ -1553,7 +1553,7 @@ exports.ColorPanelBase = Montage.create(Component, { this.colorManager.hsv = color.c; break; default: - this.colorManager.applyNoColor(); + this.colorManager.applyNoColor(true); break; } // diff --git a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js index 4161cb50..ded06797 100755 --- a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js +++ b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js @@ -50,8 +50,8 @@ exports.ColorPanelPopup = Montage.create(Component, { //////////////////////////////////////////////////////////////////// // setNoColor: { - value: function (e) { - if (this.colorManager) this.colorManager.applyNoColor(); + value: function (code) { + if (this.colorManager) this.colorManager.applyNoColor(code); } }, //////////////////////////////////////////////////////////////////// @@ -308,7 +308,7 @@ exports.ColorPanelPopup = Montage.create(Component, { color.type = 'change'; this.colorManager.hsl = color; } else { - this.colorManager.applyNoColor(); + this.colorManager.applyNoColor(false); } } else { color = this.colorManager.hexToRgb(b._event.srcElement.colorValue); @@ -317,7 +317,7 @@ exports.ColorPanelPopup = Montage.create(Component, { color.type = 'change'; this.colorManager.rgb = color; } else { - this.colorManager.applyNoColor(); + this.colorManager.applyNoColor(false); } } } diff --git a/js/panels/color/colortoolbar.reel/colortoolbar.js b/js/panels/color/colortoolbar.reel/colortoolbar.js index 6b8e476b..bf4d307f 100755 --- a/js/panels/color/colortoolbar.reel/colortoolbar.js +++ b/js/panels/color/colortoolbar.reel/colortoolbar.js @@ -108,7 +108,7 @@ exports.ColorToolbar = Montage.create(Component, { color.mode = e._event.colorMode; this.application.ninja.colorController.colorModel[e._event.colorMode] = color; } else { - this.application.ninja.colorController.colorModel.applyNoColor(); + this.application.ninja.colorController.colorModel.applyNoColor(false); } this.application.ninja.colorController.colorModel.input = 'chip'; }.bind(this)); @@ -125,7 +125,7 @@ exports.ColorToolbar = Montage.create(Component, { color.mode = e._event.colorMode; this.application.ninja.colorController.colorModel[e._event.colorMode] = color; } else { - this.application.ninja.colorController.colorModel.applyNoColor(); + this.application.ninja.colorController.colorModel.applyNoColor(false); } this.application.ninja.colorController.colorModel.input = 'chip'; }.bind(this)); -- cgit v1.2.3