From c24f58c10231c30d3a8a4c9fb9a4f395dd746180 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 12 Mar 2012 16:25:47 -0700 Subject: Merge dhg637 DisabledState into master. Committing Disabled states for tool-bar, tool-options, viewbar, breadcrumb Signed-off-by: Valerio Virgillito --- .../tools-properties.reel/tools-properties.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'js/components/layout/tools-properties.reel/tools-properties.js') diff --git a/js/components/layout/tools-properties.reel/tools-properties.js b/js/components/layout/tools-properties.reel/tools-properties.js index 104aabb7..47945b58 100755 --- a/js/components/layout/tools-properties.reel/tools-properties.js +++ b/js/components/layout/tools-properties.reel/tools-properties.js @@ -9,10 +9,29 @@ var Component = require("montage/ui/component").Component; exports.ToolsProperties = Montage.create(Component, { + disabled: { + value: true + }, + + handleCloseDocument: { + value: function(){ + if(!this.application.ninja.documentController.activeDocument) { + this.disabled = true; + } + } + }, + + handleOpenDocument: { + value: function() { + this.disabled = false; + } + }, + prepareForDraw: { enumerable: false, value: function() { - //this.selectedTool = this.application.toolsData.selectedTool; + this.eventManager.addEventListener( "openDocument", this, false); + this.eventManager.addEventListener( "closeDocument", this, false); } }, -- cgit v1.2.3