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 --- .../tools-properties.reel/tools-properties.js | 42 +++++++++++++++++----- 1 file changed, 34 insertions(+), 8 deletions(-) (limited to 'js/components/layout/tools-properties.reel') diff --git a/js/components/layout/tools-properties.reel/tools-properties.js b/js/components/layout/tools-properties.reel/tools-properties.js index 47945b58..c25559ae 100755 --- a/js/components/layout/tools-properties.reel/tools-properties.js +++ b/js/components/layout/tools-properties.reel/tools-properties.js @@ -9,10 +9,43 @@ var Component = require("montage/ui/component").Component; exports.ToolsProperties = Montage.create(Component, { - disabled: { + _currentDocument: { + enumerable: false, + value: null + }, + + currentDocument: { + enumerable: false, + get: function() { + return this._currentDocument; + }, + set: function(value) { + if (value === this._currentDocument) { + return; + } + + this._currentDocument = value; + + this.disabled = !this._currentDocument; + + } + }, + + _disabled: { value: true }, + disabled: { + get: function() { + return this._disabled; + }, + set: function(value) { + if(value !== this._disabled) { + this._disabled = value; + } + } + }, + handleCloseDocument: { value: function(){ if(!this.application.ninja.documentController.activeDocument) { @@ -21,16 +54,9 @@ exports.ToolsProperties = Montage.create(Component, { } }, - handleOpenDocument: { - value: function() { - this.disabled = false; - } - }, - prepareForDraw: { enumerable: false, value: function() { - this.eventManager.addEventListener( "openDocument", this, false); this.eventManager.addEventListener( "closeDocument", this, false); } }, -- cgit v1.2.3 From 5d7dff15e1e603e3b37057b9843e4b1eef1b2dca Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 29 May 2012 15:32:47 -0700 Subject: cleanup and handling the document views in the document controller for now. Signed-off-by: Valerio Virgillito --- .../tools-properties.reel/tools-properties.js | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'js/components/layout/tools-properties.reel') diff --git a/js/components/layout/tools-properties.reel/tools-properties.js b/js/components/layout/tools-properties.reel/tools-properties.js index c25559ae..6ea4ad85 100755 --- a/js/components/layout/tools-properties.reel/tools-properties.js +++ b/js/components/layout/tools-properties.reel/tools-properties.js @@ -46,28 +46,6 @@ exports.ToolsProperties = Montage.create(Component, { } }, - handleCloseDocument: { - value: function(){ - if(!this.application.ninja.documentController.activeDocument) { - this.disabled = true; - } - } - }, - - prepareForDraw: { - enumerable: false, - value: function() { - this.eventManager.addEventListener( "closeDocument", this, false); - } - }, - - draw: { - enumerable: false, - value: function() { - //this.selectionProperties.needsDraw = true; - } - }, - _currentSelectedTool : { value: null }, -- cgit v1.2.3