From f704705fd85c1af44ad86f8c29e8e93d330796e5 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 27 Jun 2012 15:31:53 -0700 Subject: Adding a dismiss step when switching popups This is needed to allow for model to change during draw routines --- js/panels/color/colorpanelbase.reel/colorpanelbase.js | 4 ++++ js/panels/color/colorpopup-manager.js | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'js/panels') diff --git a/js/panels/color/colorpanelbase.reel/colorpanelbase.js b/js/panels/color/colorpanelbase.reel/colorpanelbase.js index db46ced7..40c384fb 100755 --- a/js/panels/color/colorpanelbase.reel/colorpanelbase.js +++ b/js/panels/color/colorpanelbase.reel/colorpanelbase.js @@ -1469,6 +1469,10 @@ exports.ColorPanelBase = Montage.create(Component, { } } } else { + if (this.colorManager.input === 'chip') { + this.application.ninja.colorController.colorPopupManager.hideColorPopup(); + return; + } //TODO: Change popup to use montage's built in popup this.application.ninja.colorController.colorPopupManager.hideColorPopup(); // diff --git a/js/panels/color/colorpopup-manager.js b/js/panels/color/colorpopup-manager.js index d5cc8ac8..493cb801 100755 --- a/js/panels/color/colorpopup-manager.js +++ b/js/panels/color/colorpopup-manager.js @@ -192,6 +192,7 @@ exports.ColorPopupManager = Montage.create(Component, { if (this._popupBase && this._popupBase.opened) { //Toogles if called and opened this.hideColorPopup(); + return; } else { this._colorPopupDrawing = true; //////////////////////////////////////////////////// @@ -373,7 +374,10 @@ exports.ColorPopupManager = Montage.create(Component, { return; } //Hidding other popup if opened - if (this._popupBase && this._popupBase.opened) this.hideColorPopup(); + if (this._popupBase && this._popupBase.opened) { + this.hideColorPopup(); + return; + } // this._popupChipBtn = this.application.ninja.colorController.colorView.currentChip; // @@ -620,7 +624,7 @@ exports.ColorPopupManager = Montage.create(Component, { } this.colorChipChange(e); } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'nocolor')) { - this.colorChipChange(e); + this.colorChipChange(e); } else if (!e._event.wasSetByCode && (e._event.mode && e._event.mode === 'hex')) { this.colorChipChange(e); } -- cgit v1.2.3