diff options
author | Kruti Shah | 2012-06-12 13:09:11 -0700 |
---|---|---|
committer | Kruti Shah | 2012-06-12 13:09:11 -0700 |
commit | d648c842905c7c53e0f89b943982493d2b79f56e (patch) | |
tree | eb5585f92061975215f6d19305a8d1b76262e2fc /js/components/layout/bread-crumb.reel/bread-crumb.js | |
parent | bedb38e14887b29eae3cdf1c8d435259c920257c (diff) | |
parent | cf3b96822665751dae7a64644db3cb3960733c3d (diff) | |
download | ninja-d648c842905c7c53e0f89b943982493d2b79f56e.tar.gz |
Merge branch 'refs/heads/TimelineUberjd' into TimelineUber
Conflicts:
js/controllers/elements/element-controller.js
js/document/_toDelete/html-document.js
js/panels/Timeline/Layer.reel/Layer.js
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/components/layout/bread-crumb.reel/bread-crumb.js')
-rwxr-xr-x | js/components/layout/bread-crumb.reel/bread-crumb.js | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index 49dbe3cb..ac131f2c 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js | |||
@@ -9,21 +9,44 @@ var Montage = require("montage/core/core").Montage, | |||
9 | 9 | ||
10 | exports.Breadcrumb = Montage.create(Component, { | 10 | exports.Breadcrumb = Montage.create(Component, { |
11 | 11 | ||
12 | disabled: { | 12 | _currentDocument: { |
13 | value: true | 13 | enumerable: false, |
14 | value: null | ||
14 | }, | 15 | }, |
15 | 16 | ||
16 | handleOpenDocument: { | 17 | currentDocument: { |
17 | value: function(){ | 18 | enumerable: false, |
18 | this.disabled = false; | 19 | get: function() { |
20 | return this._currentDocument; | ||
21 | }, | ||
22 | set: function(value) { | ||
23 | if (value === this._currentDocument) { | ||
24 | return; | ||
25 | } | ||
26 | |||
27 | this._currentDocument = value; | ||
28 | |||
29 | if(!value) { | ||
30 | this.disabled = true; | ||
31 | } else { | ||
32 | this.disabled = this._currentDocument.currentView !== "design"; | ||
33 | } | ||
34 | |||
19 | } | 35 | } |
20 | }, | 36 | }, |
21 | 37 | ||
22 | handleCloseDocument: { | 38 | |
23 | value: function(){ | 39 | _disabled: { |
24 | if(!this.application.ninja.documentController.activeDocument && this.application.ninja.currentDocument.currentView !== "code") { | 40 | value: true |
25 | this.disabled = true; | 41 | }, |
26 | this.application.ninja.currentSelectedContainer = (this.application.ninja.currentDocument ? this.application.ninja.currentDocument.model.documentRoot : null); | 42 | |
43 | disabled: { | ||
44 | get: function() { | ||
45 | return this._disabled; | ||
46 | }, | ||
47 | set: function(value) { | ||
48 | if(value !== this._disabled) { | ||
49 | this._disabled = value; | ||
27 | } | 50 | } |
28 | } | 51 | } |
29 | }, | 52 | }, |
@@ -50,8 +73,6 @@ exports.Breadcrumb = Montage.create(Component, { | |||
50 | 73 | ||
51 | prepareForDraw: { | 74 | prepareForDraw: { |
52 | value: function() { | 75 | value: function() { |
53 | this.eventManager.addEventListener("openDocument", this, false); | ||
54 | this.eventManager.addEventListener("closeDocument", this, false); | ||
55 | this.breadcrumbBt.addEventListener("action", this, false); | 76 | this.breadcrumbBt.addEventListener("action", this, false); |
56 | } | 77 | } |
57 | }, | 78 | }, |
@@ -65,7 +86,7 @@ exports.Breadcrumb = Montage.create(Component, { | |||
65 | 86 | ||
66 | parentNode = this.container; | 87 | parentNode = this.container; |
67 | 88 | ||
68 | while(parentNode !== this.application.ninja.currentDocument.model.documentRoot) { | 89 | while(parentNode !== this.currentDocument.model.documentRoot) { |
69 | this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); | 90 | this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); |
70 | parentNode = parentNode.parentNode; | 91 | parentNode = parentNode.parentNode; |
71 | } | 92 | } |
@@ -87,6 +108,7 @@ exports.Breadcrumb = Montage.create(Component, { | |||
87 | this.containerElements.pop(); | 108 | this.containerElements.pop(); |
88 | } | 109 | } |
89 | 110 | ||
111 | // TODO: This is bound 2 ways, update the internal property | ||
90 | this.application.ninja.currentSelectedContainer = this.containerElements[i].node; | 112 | this.application.ninja.currentSelectedContainer = this.containerElements[i].node; |
91 | } | 113 | } |
92 | } | 114 | } |