From ac2db49e51f82f5a1cf52ec854b047e007ffbdd7 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 12 Mar 2012 13:39:58 -0700 Subject: Committing Disabled states for tool-bar, tool-options, viewbar, breadcrumb Signed-off-by: Armen Kesablyan --- js/components/layout/tools-list.reel/tools-list.html | 16 ++++++++++++++++ js/components/layout/tools-list.reel/tools-list.js | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) (limited to 'js/components/layout/tools-list.reel') diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html index 2c5617e5..3e49a4f3 100755 --- a/js/components/layout/tools-list.reel/tools-list.html +++ b/js/components/layout/tools-list.reel/tools-list.html @@ -165,6 +165,21 @@ {"@": "repetition1"} ] } + }, + + "disabledCondition": { + "module": "montage/ui/condition.reel", + "name": "Condition", + "properties": { + "element": {"#": "disabledCondition"} + }, + "bindings": { + "condition": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "disabled", + "oneway": true + } + } } @@ -184,6 +199,7 @@
+
diff --git a/js/components/layout/tools-list.reel/tools-list.js b/js/components/layout/tools-list.reel/tools-list.js index e26ab391..b44f63b3 100755 --- a/js/components/layout/tools-list.reel/tools-list.js +++ b/js/components/layout/tools-list.reel/tools-list.js @@ -29,10 +29,27 @@ exports.ToolsList = Montage.create(Component, { RotateStageTool3D: { value: null }, PanTool: { value: null }, ZoomTool: { value: null }, + disabled: { value: true}, + + handleOnOpenDocument: { + value: function(){ + this.disabled = false; + } + }, + + handleCloseDocument: { + value: function(){ + if(!this.application.ninja.documentController.activeDocument) { + this.disabled = true; + } + } + }, prepareForDraw: { enumerable: false, value: function() { + this.eventManager.addEventListener( "onOpenDocument", this, false); + this.eventManager.addEventListener( "closeDocument", this, false); this.PenTool.options = this.application.ninja.toolsProperties.shapeProperties.lineProperties;//this.application.Ninja.toolsProperties.penProperties; this.SelectionTool.options = this.application.ninja.toolsProperties.selectionProperties; -- cgit v1.2.3 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 --- .../layout/tools-list.reel/tools-list.html | 33 ++++++++++------------ js/components/layout/tools-list.reel/tools-list.js | 4 +-- 2 files changed, 17 insertions(+), 20 deletions(-) (limited to 'js/components/layout/tools-list.reel') diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html index 3e49a4f3..5996e446 100755 --- a/js/components/layout/tools-list.reel/tools-list.html +++ b/js/components/layout/tools-list.reel/tools-list.html @@ -136,6 +136,21 @@ "name": "ZoomTool" }, + "disable": { + "module": "montage/ui/condition.reel", + "name": "Condition", + "properties": { + "element": {"#": "disabledCondition"} + }, + "bindings": { + "condition": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "disabled", + "oneway": true + } + } + }, + "owner": { "module": "js/components/layout/tools-list.reel", "name": "ToolsList", @@ -165,25 +180,7 @@ {"@": "repetition1"} ] } - }, - - "disabledCondition": { - "module": "montage/ui/condition.reel", - "name": "Condition", - "properties": { - "element": {"#": "disabledCondition"} - }, - "bindings": { - "condition": { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "disabled", - "oneway": true - } - } } - - - } diff --git a/js/components/layout/tools-list.reel/tools-list.js b/js/components/layout/tools-list.reel/tools-list.js index b44f63b3..5ea6f70f 100755 --- a/js/components/layout/tools-list.reel/tools-list.js +++ b/js/components/layout/tools-list.reel/tools-list.js @@ -31,7 +31,7 @@ exports.ToolsList = Montage.create(Component, { ZoomTool: { value: null }, disabled: { value: true}, - handleOnOpenDocument: { + handleOpenDocument: { value: function(){ this.disabled = false; } @@ -48,7 +48,7 @@ exports.ToolsList = Montage.create(Component, { prepareForDraw: { enumerable: false, value: function() { - this.eventManager.addEventListener( "onOpenDocument", this, false); + this.eventManager.addEventListener( "openDocument", this, false); this.eventManager.addEventListener( "closeDocument", this, false); this.PenTool.options = this.application.ninja.toolsProperties.shapeProperties.lineProperties;//this.application.Ninja.toolsProperties.penProperties; -- cgit v1.2.3