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.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'js/components/layout/bread-crumb.reel/bread-crumb.js') 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.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'js/components/layout/bread-crumb.reel/bread-crumb.js') 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