From 4c3aac5eabd93052b1554a03d78235215bb49db4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 29 May 2012 00:34:40 -0700 Subject: document bindings phase 1 - using array controller to bind the current document to all ninja components - removed open document event - removed references to the document controller Signed-off-by: Valerio Virgillito --- js/panels/Panel.reel/Panel.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'js/panels/Panel.reel') diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js index 613bef4b..14b25c36 100755 --- a/js/panels/Panel.reel/Panel.js +++ b/js/panels/Panel.reel/Panel.js @@ -100,6 +100,30 @@ exports.Panel = Montage.create(Component, { } }, + _currentDocument: { + value : null, + enumerable : false + }, + + currentDocument : { + get : function() { + return this._currentDocument; + }, + set : function(value) { + if (value === this._currentDocument) { + return; + } + + this._currentDocument = value; + + if(typeof this.panelContent.content[0].controller._currentDocument !== "undefined") { + this.panelContent.content[0].controller.currentDocument = this._currentDocument; + } + + this.disabled = this._currentDocument.currentView !== "design"; + } + }, + handleBtnCollapseAction: { value: function() { this.collapsed = !this.collapsed; -- cgit v1.2.3 From 31b094ee21102f99a4021d505bc3a28527c9e23d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 30 May 2012 01:33:20 -0700 Subject: Fixing the close document. Signed-off-by: Valerio Virgillito --- js/panels/Panel.reel/Panel.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'js/panels/Panel.reel') diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js index 14b25c36..0c5f0b4b 100755 --- a/js/panels/Panel.reel/Panel.js +++ b/js/panels/Panel.reel/Panel.js @@ -120,7 +120,12 @@ exports.Panel = Montage.create(Component, { this.panelContent.content[0].controller.currentDocument = this._currentDocument; } - this.disabled = this._currentDocument.currentView !== "design"; + if(!value) { + this.disabled = true; + } else { + this.disabled = this._currentDocument.currentView !== "design"; + } + } }, -- cgit v1.2.3