diff options
author | Valerio Virgillito | 2012-07-31 15:18:51 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-07-31 15:18:51 -0700 |
commit | 4343e1f92547df9f7d42eecdf7e4feb47ad960e8 (patch) | |
tree | 27913b22fc5a899ae679013427d3cfe4b497837a /js/ui/menu | |
parent | d68ad5c4aa404f66303833367700983b8d7f5303 (diff) | |
parent | b391dde5f319bf4c534e9fce523c22be3bb16ace (diff) | |
download | ninja-4343e1f92547df9f7d42eecdf7e4feb47ad960e8.tar.gz |
Merge pull request #422 from joseeight/Document
Document Code View
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; |