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/document-bar.reel/document-bar.css | 2 -- .../layout/document-bar.reel/document-bar.html | 15 +++++++++++++++ .../layout/document-bar.reel/document-bar.js | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) (limited to 'js/components/layout/document-bar.reel') 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){ -- 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/document-bar.reel/document-bar.html | 26 +++++++++++----------- .../layout/document-bar.reel/document-bar.js | 10 ++++----- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'js/components/layout/document-bar.reel') 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; } -- cgit v1.2.3