diff options
Diffstat (limited to 'js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js')
-rw-r--r-- | js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js index 9344d34c..2ca6118b 100644 --- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js +++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js | |||
@@ -51,14 +51,31 @@ exports.CodeEditorViewOptions = Montage.create(Component, { | |||
51 | 51 | ||
52 | this._currentDocument = value; | 52 | this._currentDocument = value; |
53 | 53 | ||
54 | if(!value || this._currentDocument.currentView === "design") { | 54 | if(!value || (this._currentDocument.currentView === "design")) { |
55 | this.visible = false; | 55 | this.visible = false; |
56 | } else { | 56 | } else if(this._currentDocument && this._currentDocument.currentView === "code") { |
57 | this.visible = true; | 57 | |
58 | if(this._currentDocument.model.views.design){//code view of design document | ||
59 | this.application.ninja.editorViewOptions.visible = false; | ||
60 | //this.application.ninja.documentBar.codeEditorControls.visible = false;//todo | ||
61 | }else if(!this._currentDocument.model.views.design){//code view for text document | ||
62 | this.application.ninja.editorViewOptions.visible = true; | ||
63 | //this.application.ninja.documentBar.codeEditorControls.visible = false; | ||
64 | } | ||
65 | |||
58 | this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension]; | 66 | this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension]; |
59 | this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked; | 67 | this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked; |
60 | } | 68 | } |
61 | 69 | ||
70 | if(this._currentDocument && (this._currentDocument.currentView === "design")) { | ||
71 | this._currentDocument.addPropertyChangeListener("model.currentViewIdentifier", this, false); | ||
72 | } | ||
73 | |||
74 | //hide the zoom hottext if it is code view of a design file | ||
75 | if (this._currentDocument && this._currentDocument.model && this._currentDocument.model.views.code){ | ||
76 | this.zoomHottext.element.style.display = "block"; | ||
77 | } | ||
78 | |||
62 | } | 79 | } |
63 | }, | 80 | }, |
64 | 81 | ||
@@ -209,6 +226,18 @@ exports.CodeEditorViewOptions = Montage.create(Component, { | |||
209 | } | 226 | } |
210 | }, | 227 | }, |
211 | 228 | ||
229 | handleChange: { | ||
230 | value: function(notification) { | ||
231 | if(notification.currentPropertyPath === "model.currentViewIdentifier") { | ||
232 | if(this.currentDocument.model.currentView.identifier === "design-code") { | ||
233 | //this.application.ninja.documentBar.codeEditorControls.visible = false;//todo | ||
234 | } else { | ||
235 | //this.application.ninja.documentBar.codeEditorControls.visible = false; | ||
236 | } | ||
237 | } | ||
238 | } | ||
239 | }, | ||
240 | |||
212 | handleFormat:{ | 241 | handleFormat:{ |
213 | value: function(evt){ | 242 | value: function(evt){ |
214 | var range = this.getSelectedRange(this.currentDocument.model.views.code.editor); | 243 | var range = this.getSelectedRange(this.currentDocument.model.views.code.editor); |