diff options
author | Jose Antonio Marquez Russo | 2012-07-25 07:52:19 -0700 |
---|---|---|
committer | Jose Antonio Marquez Russo | 2012-07-25 07:52:19 -0700 |
commit | bb2f1d0e9a559f44348e95ad726801a5031aea3a (patch) | |
tree | a73b1dbc93fd8cba24bc97475905d182d90a1d6b /js/ui/menu | |
parent | c127d66ed02d61e281ce931a6caecfdcef7f2999 (diff) | |
parent | 1fae8b14621970680ca51c2a4a5f4f8006e1aee2 (diff) | |
download | ninja-bb2f1d0e9a559f44348e95ad726801a5031aea3a.tar.gz |
Merge pull request #46 from mencio/document-switch
design/code view switching for stage and menu
Diffstat (limited to 'js/ui/menu')
-rw-r--r-- | js/ui/menu/menu-controller.js | 17 |
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; |