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 | 30 |
1 files changed, 23 insertions, 7 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 5ad36db5..70d033fb 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 | |||
@@ -57,16 +57,25 @@ exports.CodeEditorViewOptions = Montage.create(Component, { | |||
57 | 57 | ||
58 | if(this._currentDocument.model.views.design){//code view of design document | 58 | if(this._currentDocument.model.views.design){//code view of design document |
59 | this.application.ninja.editorViewOptions.visible = false; | 59 | this.application.ninja.editorViewOptions.visible = false; |
60 | this.application.ninja.documentBar.codeEditorControls.visible = true; | 60 | //this.application.ninja.documentBar.codeEditorControls.visible = false;//todo |
61 | }else if(!this._currentDocument.model.views.design){//code view for text document | 61 | }else if(!this._currentDocument.model.views.design){//code view for text document |
62 | this.application.ninja.editorViewOptions.visible = true; | 62 | this.application.ninja.editorViewOptions.visible = true; |
63 | this.application.ninja.documentBar.codeEditorControls.visible = false; | 63 | //this.application.ninja.documentBar.codeEditorControls.visible = false; |
64 | } | 64 | } |
65 | 65 | ||
66 | this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension]; | 66 | this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension]; |
67 | this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked; | 67 | this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked; |
68 | } | 68 | } |
69 | 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 | |||
70 | } | 79 | } |
71 | }, | 80 | }, |
72 | 81 | ||
@@ -208,11 +217,6 @@ exports.CodeEditorViewOptions = Montage.create(Component, { | |||
208 | } else { | 217 | } else { |
209 | this.autoCompleteLabel.classList.remove("disabled"); | 218 | this.autoCompleteLabel.classList.remove("disabled"); |
210 | } | 219 | } |
211 | |||
212 | //hide the zoom hottext if it is code view of a design file | ||
213 | if (this._currentDocument && this._currentDocument.model && this._currentDocument.model.views.design){ | ||
214 | this.zoomHottext.element.style.display = "none"; | ||
215 | } | ||
216 | } | 220 | } |
217 | }, | 221 | }, |
218 | 222 | ||
@@ -222,6 +226,18 @@ exports.CodeEditorViewOptions = Montage.create(Component, { | |||
222 | } | 226 | } |
223 | }, | 227 | }, |
224 | 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 | |||
225 | handleFormat:{ | 241 | handleFormat:{ |
226 | value: function(evt){ | 242 | value: function(evt){ |
227 | var range = this.getSelectedRange(this.currentDocument.model.views.code.editor); | 243 | var range = this.getSelectedRange(this.currentDocument.model.views.code.editor); |