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 --- .../layout/bread-crumb.reel/bread-crumb.css | 2 +- .../layout/bread-crumb.reel/bread-crumb.html | 15 +++++++++++++++ .../layout/bread-crumb.reel/bread-crumb.js | 21 +++++++++++++++++++++ .../layout/document-bar.reel/document-bar.css | 2 -- .../layout/document-bar.reel/document-bar.html | 15 +++++++++++++++ .../layout/document-bar.reel/document-bar.js | 19 +++++++++++++++++++ .../layout/tools-list.reel/tools-list.html | 16 ++++++++++++++++ js/components/layout/tools-list.reel/tools-list.js | 17 +++++++++++++++++ 8 files changed, 104 insertions(+), 3 deletions(-) (limited to 'js/components/layout') diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.css b/js/components/layout/bread-crumb.reel/bread-crumb.css index 67497e10..dcfd471c 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.css +++ b/js/components/layout/bread-crumb.reel/bread-crumb.css @@ -8,7 +8,7 @@ background-color: #282828; border-style: double; height: 26px; - + position:relative; -webkit-box-flex: 0; } diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html index f2368e9a..9f24cee5 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.html +++ b/js/components/layout/bread-crumb.reel/bread-crumb.html @@ -60,6 +60,20 @@ "oneway": true } } + }, + "Disable": { + "module": "montage/ui/condition.reel", + "name": "Condition", + "properties": { + "element": {"#": "disabledCondition"} + }, + "bindings": { + "condition": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "disabled", + "oneway": true + } + } } } @@ -71,6 +85,7 @@ +
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index b2fa42b1..ff1d1071 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js @@ -9,6 +9,25 @@ var Montage = require("montage/core/core").Montage, exports.Breadcrumb = Montage.create(Component, { + disabled: { + value: true + }, + + handleOnOpenDocument: { + value: function(){ + this.disabled = false; + } + }, + + handleCloseDocument: { + value: function(){ + if(!this.application.ninja.documentController.activeDocument) { + this.disabled = true; + } + } + }, + + _container:{ value:null }, @@ -31,6 +50,8 @@ exports.Breadcrumb = Montage.create(Component, { prepareForDraw: { value: function() { + this.eventManager.addEventListener( "onOpenDocument", this, false); + this.eventManager.addEventListener( "closeDocument", this, false); this.breadcrumbBt.addEventListener("action", this, false); } }, diff --git a/js/components/layout/document-bar.reel/document-bar.css b/js/components/layout/document-bar.reel/document-bar.css index 2a147964..f3e5de07 100755 --- a/js/components/layout/document-bar.reel/document-bar.css +++ b/js/components/layout/document-bar.reel/document-bar.css @@ -4,8 +4,6 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ .documentBar { - height: 25px; - width: 1000px; position: relative; overflow: hidden; color: white; diff --git a/js/components/layout/document-bar.reel/document-bar.html b/js/components/layout/document-bar.reel/document-bar.html index 48f1423c..5a4ca2be 100755 --- a/js/components/layout/document-bar.reel/document-bar.html +++ b/js/components/layout/document-bar.reel/document-bar.html @@ -41,6 +41,20 @@ "codeView": {"#": "code"}, "zoomControl": {"@": "hottext1"} } + }, + "Disable": { + "module": "montage/ui/condition.reel", + "name": "Condition", + "properties": { + "element": {"#": "disabledCondition"} + }, + "bindings": { + "condition": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "disabled", + "oneway": true + } + } } } @@ -53,6 +67,7 @@ Design View Code View +
\ No newline at end of file diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js index ea5e3280..1f2deb59 100755 --- a/js/components/layout/document-bar.reel/document-bar.js +++ b/js/components/layout/document-bar.reel/document-bar.js @@ -13,6 +13,9 @@ exports.DocumentBar = Montage.create(Component, { codeView: { value: null, enumerable: false}, zoomControl: { value: null, enumerable: false }, _type: { enumerable: false, value: null }, + disabled: {value: true}, + + type: { enumerable: false, @@ -84,6 +87,8 @@ exports.DocumentBar = Montage.create(Component, { prepareForDraw: { value: function() { + this.eventManager.addEventListener( "onOpenDocument", this, false); + this.eventManager.addEventListener( "closeDocument", this, false); this.designView.addEventListener("click", this, false); this.codeView.addEventListener("click", this, false); @@ -99,6 +104,20 @@ exports.DocumentBar = Montage.create(Component, { } }, + handleOnOpenDocument: { + value: function(){ + this.disabled = false; + } + }, + + handleCloseDocument: { + value: function(){ + if(!this.application.ninja.documentController.activeDocument) { + this.disabled = true; + } + } + }, + handleOnDocumentChanged:{ value:function(event){ 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/bread-crumb.reel/bread-crumb.html | 6 ++-- .../layout/bread-crumb.reel/bread-crumb.js | 7 ++--- .../layout/document-bar.reel/document-bar.html | 26 ++++++++--------- .../layout/document-bar.reel/document-bar.js | 10 +++---- .../layout/tools-list.reel/tools-list.html | 33 ++++++++++------------ js/components/layout/tools-list.reel/tools-list.js | 4 +-- .../tools-properties.reel/tools-properties.html | 16 +++++++++++ .../tools-properties.reel/tools-properties.js | 21 +++++++++++++- 8 files changed, 77 insertions(+), 46 deletions(-) (limited to 'js/components/layout') diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html index 9f24cee5..413f588d 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.html +++ b/js/components/layout/bread-crumb.reel/bread-crumb.html @@ -61,9 +61,9 @@ } } }, - "Disable": { - "module": "montage/ui/condition.reel", - "name": "Condition", + + "disable": { + "prototype": "montage/ui/condition.reel", "properties": { "element": {"#": "disabledCondition"} }, diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index ff1d1071..ab390fc6 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js @@ -13,7 +13,7 @@ exports.Breadcrumb = Montage.create(Component, { value: true }, - handleOnOpenDocument: { + handleOpenDocument: { value: function(){ this.disabled = false; } @@ -27,7 +27,6 @@ exports.Breadcrumb = Montage.create(Component, { } }, - _container:{ value:null }, @@ -50,8 +49,8 @@ exports.Breadcrumb = Montage.create(Component, { prepareForDraw: { value: function() { - this.eventManager.addEventListener( "onOpenDocument", this, false); - this.eventManager.addEventListener( "closeDocument", this, false); + this.eventManager.addEventListener("openDocument", this, false); + this.eventManager.addEventListener("closeDocument", this, false); this.breadcrumbBt.addEventListener("action", this, false); } }, diff --git a/js/components/layout/document-bar.reel/document-bar.html b/js/components/layout/document-bar.reel/document-bar.html index 5a4ca2be..bd13f231 100755 --- a/js/components/layout/document-bar.reel/document-bar.html +++ b/js/components/layout/document-bar.reel/document-bar.html @@ -32,19 +32,8 @@ } }, - "owner": { - "module": "js/components/layout/document-bar.reel", - "name": "DocumentBar", - "properties": { - "element": {"#": "documentBar"}, - "designView": {"#": "design"}, - "codeView": {"#": "code"}, - "zoomControl": {"@": "hottext1"} - } - }, - "Disable": { - "module": "montage/ui/condition.reel", - "name": "Condition", + "disable": { + "prototype": "montage/ui/condition.reel", "properties": { "element": {"#": "disabledCondition"} }, @@ -55,6 +44,17 @@ "oneway": true } } + }, + + "owner": { + "module": "js/components/layout/document-bar.reel", + "name": "DocumentBar", + "properties": { + "element": {"#": "documentBar"}, + "designView": {"#": "design"}, + "codeView": {"#": "code"}, + "zoomControl": {"@": "hottext1"} + } } } diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js index 1f2deb59..4dc39fd6 100755 --- a/js/components/layout/document-bar.reel/document-bar.js +++ b/js/components/layout/document-bar.reel/document-bar.js @@ -13,7 +13,7 @@ exports.DocumentBar = Montage.create(Component, { codeView: { value: null, enumerable: false}, zoomControl: { value: null, enumerable: false }, _type: { enumerable: false, value: null }, - disabled: {value: true}, + disabled: { value: true }, @@ -87,7 +87,7 @@ exports.DocumentBar = Montage.create(Component, { prepareForDraw: { value: function() { - this.eventManager.addEventListener( "onOpenDocument", this, false); + this.eventManager.addEventListener( "openDocument", this, false); this.eventManager.addEventListener( "closeDocument", this, false); this.designView.addEventListener("click", this, false); this.codeView.addEventListener("click", this, false); @@ -104,14 +104,14 @@ exports.DocumentBar = Montage.create(Component, { } }, - handleOnOpenDocument: { - value: function(){ + handleOpenDocument: { + value: function() { this.disabled = false; } }, handleCloseDocument: { - value: function(){ + value: function() { if(!this.application.ninja.documentController.activeDocument) { this.disabled = true; } 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; diff --git a/js/components/layout/tools-properties.reel/tools-properties.html b/js/components/layout/tools-properties.reel/tools-properties.html index 49f2d776..3c7a92fa 100755 --- a/js/components/layout/tools-properties.reel/tools-properties.html +++ b/js/components/layout/tools-properties.reel/tools-properties.html @@ -136,6 +136,21 @@ "element": {"#": "zoomProperties"} } }, + + "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-properties.reel", @@ -191,6 +206,7 @@
+
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