From 79d5971630b91eea6cf1db03fa9816815b37cb54 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 1 Aug 2012 22:38:49 -0700 Subject: fixing the panels being disabled when going from code to design view in multiple documents Signed-off-by: Valerio Virgillito --- js/panels/Panel.reel/Panel.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js/panels') diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js index 988088e3..586636e1 100755 --- a/js/panels/Panel.reel/Panel.js +++ b/js/panels/Panel.reel/Panel.js @@ -159,11 +159,24 @@ exports.Panel = Montage.create(Component, { this.disabled = true; } else { this.disabled = this._currentDocument.currentView !== "design"; + this._currentDocument.addPropertyChangeListener("model.currentViewIdentifier", this, false); } } }, + handleChange: { + value: function(notification) { + if(notification.currentPropertyPath === "model.currentViewIdentifier") { + if(this.currentDocument.model.currentView.identifier === "design-code") { + this.disabled = true; + } else { + this.disabled = false; + } + } + } + }, + handleBtnCollapseAction: { value: function() { this.collapsed = !this.collapsed; -- cgit v1.2.3