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 +++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) (limited to 'js/components/layout/bread-crumb.reel') 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); } }, -- 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 --- js/components/layout/bread-crumb.reel/bread-crumb.html | 6 +++--- js/components/layout/bread-crumb.reel/bread-crumb.js | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'js/components/layout/bread-crumb.reel') 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); } }, -- cgit v1.2.3