From 9ebf80d943b894242d90cf62bc3078c6a83041ad Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 26 Jun 2012 13:39:56 -0700 Subject: Fixing gradient/solid color toggle Also added a null value setter fix for no color hex --- js/panels/color/colorpanelbase.reel/colorpanelbase.js | 4 +++- js/panels/color/colorpopup-manager.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'js/panels') diff --git a/js/panels/color/colorpanelbase.reel/colorpanelbase.js b/js/panels/color/colorpanelbase.reel/colorpanelbase.js index b3045db1..db46ced7 100755 --- a/js/panels/color/colorpanelbase.reel/colorpanelbase.js +++ b/js/panels/color/colorpanelbase.reel/colorpanelbase.js @@ -482,12 +482,14 @@ exports.ColorPanelBase = Montage.create(Component, { this.ctx.clearRect(0, 0, this.cvs.width, this.cvs.height); if (m === 'gradient') { this.style.backgroundImage = c.css; + this.style.backgroundColor = 'transparent'; } else { this.style.backgroundColor = c.css; + this.style.backgroundImage = 'none'; } } else { this.drawNoColor(this, this.cvs); - }9 + } this.colorValue = c; this.colorMode = m; this.otherInput = false; diff --git a/js/panels/color/colorpopup-manager.js b/js/panels/color/colorpopup-manager.js index caccf977..5be652c9 100755 --- a/js/panels/color/colorpopup-manager.js +++ b/js/panels/color/colorpopup-manager.js @@ -605,6 +605,7 @@ exports.ColorPopupManager = Montage.create(Component, { if (e._event.gradient && !e._event.wasSetByCode) { // this._popupChipBtn.color('gradient', e._event.gradient); + this._popupChipBase._components.hex.value = null; } else if (!isNaN(e._target._xStart) && !e._event.wasSetByCode) { this.colorChipChange(e); } @@ -617,6 +618,7 @@ exports.ColorPopupManager = Montage.create(Component, { } else if (!this._popupBase || (this._popupBase && !this._popupBase.opened)){ if (e._event.gradient && !e._event.wasSetByCode) { this._popupChipBtn.color('gradient', e._event.gradient); + this._popupChipBase._components.hex.value = null; } else if (!isNaN(e._target._xStart) && !e._event.wasSetByCode) { this.colorGradientChipChange(e); } -- cgit v1.2.3