aboutsummaryrefslogtreecommitdiff
path: root/js/ui
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-25 00:04:22 -0700
committerValerio Virgillito2012-07-25 00:04:22 -0700
commit1fae8b14621970680ca51c2a4a5f4f8006e1aee2 (patch)
treea73b1dbc93fd8cba24bc97475905d182d90a1d6b /js/ui
parentc127d66ed02d61e281ce931a6caecfdcef7f2999 (diff)
downloadninja-1fae8b14621970680ca51c2a4a5f4f8006e1aee2.tar.gz
design/code view switching for stage and menu
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/ui')
-rw-r--r--js/ui/menu/menu-controller.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/ui/menu/menu-controller.js b/js/ui/menu/menu-controller.js
index c80745f4..ebffddf1 100644
--- a/js/ui/menu/menu-controller.js
+++ b/js/ui/menu/menu-controller.js
@@ -56,6 +56,7 @@ exports.MenuController = Montage.create(Component, {
56 if(this._currentDocument && this._currentDocument.currentView === "design") { 56 if(this._currentDocument && this._currentDocument.currentView === "design") {
57 document.application.model.show3dGrid = this._currentDocument.model.draw3DGrid; 57 document.application.model.show3dGrid = this._currentDocument.model.draw3DGrid;
58 this.topLevelMenu[2].entries[5].checked = this._currentDocument.model.draw3DGrid; 58 this.topLevelMenu[2].entries[5].checked = this._currentDocument.model.draw3DGrid;
59 this._currentDocument.addPropertyChangeListener("model.currentViewIdentifier", this, false);
59 } 60 }
60 61
61 if(!this._currentDocument) { 62 if(!this._currentDocument) {
@@ -85,6 +86,22 @@ exports.MenuController = Montage.create(Component, {
85 } 86 }
86 }, 87 },
87 88
89 handleChange: {
90 value: function(notification) {
91 if(notification.currentPropertyPath === "model.currentViewIdentifier") {
92 if(this.currentDocument.model.currentView.identifier === "design-code") {
93 this.designDocumentEnabledItems.forEach(function(index) {
94 index.enabled = false;
95 });
96 } else {
97 this.designDocumentEnabledItems.forEach(function(index) {
98 index.enabled = true;
99 });
100 }
101 }
102 }
103 },
104
88 didCreate: { 105 didCreate: {
89 value: function() { 106 value: function() {
90 var self = this; 107 var self = this;