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/PanelContainer.reel/PanelContainer.js | 29 +++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'js/panels/PanelContainer.reel/PanelContainer.js') diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index 8d1d6a5e..dc501a99 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js @@ -16,7 +16,24 @@ exports.PanelContainer = Montage.create(Component, { value: null }, - // This will hold the current loaded panels. + _currentDocument: { + value : null, + enumerable : false + }, + + currentDocument : { + get : function() { + return this._currentDocument; + }, + set : function(value) { + if (value === this._currentDocument) { + return; + } + + this._currentDocument = value; + } + }, + panels: { value: [] }, @@ -65,8 +82,6 @@ exports.PanelContainer = Montage.create(Component, { this.application.localStorage.setItem("panels", this.currentPanelState); - - this.eventManager.addEventListener( "onOpenDocument", this, false); this.eventManager.addEventListener( "closeDocument", this, false); } }, @@ -89,14 +104,6 @@ exports.PanelContainer = Montage.create(Component, { } }, - handleOnOpenDocument: { - value: function(){ - this.panels.forEach(function(obj) { - obj.disabled = false; - }); - } - }, - handleCloseDocument: { value: function(){ if(!this.application.ninja.documentController.activeDocument) { -- 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/PanelContainer.reel/PanelContainer.js | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'js/panels/PanelContainer.reel/PanelContainer.js') diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index dc501a99..7cb03255 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js @@ -81,8 +81,6 @@ exports.PanelContainer = Montage.create(Component, { } this.application.localStorage.setItem("panels", this.currentPanelState); - - this.eventManager.addEventListener( "closeDocument", this, false); } }, @@ -104,16 +102,6 @@ exports.PanelContainer = Montage.create(Component, { } }, - handleCloseDocument: { - value: function(){ - if(!this.application.ninja.documentController.activeDocument) { - this.panels.forEach(function(obj) { - obj.disabled = true; - }); - } - } - }, - handleDropped: { value: function(e) { var draggedIndex, droppedIndex = 0, len = this.panels.length; -- cgit v1.2.3