From 7fa0c53c14e9029d2e3960cc81edf91592fd1768 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 25 Jul 2012 12:26:20 -0700 Subject: added save for code view, fixed code view editor bug, reuse code editor options component in document bar Signed-off-by: Ananya Sen Conflicts: js/document/views/design-code.js Signed-off-by: Ananya Sen --- .../code-editor-view-options.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'js/code-editor') 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 e2632d35..5ad36db5 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,10 +51,18 @@ exports.CodeEditorViewOptions = Montage.create(Component, { this._currentDocument = value; - if(!value || (this._currentDocument.currentView === "design") || ((this._currentDocument.model.views.design !== null))) { + if(!value || (this._currentDocument.currentView === "design")) { this.visible = false; - } else { - this.visible = true; + } else if(this._currentDocument.currentView === "code") { + + if(this._currentDocument.model.views.design){//code view of design document + this.application.ninja.editorViewOptions.visible = false; + this.application.ninja.documentBar.codeEditorControls.visible = true; + }else if(!this._currentDocument.model.views.design){//code view for text document + this.application.ninja.editorViewOptions.visible = true; + this.application.ninja.documentBar.codeEditorControls.visible = false; + } + this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension]; this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked; } @@ -200,6 +208,11 @@ exports.CodeEditorViewOptions = Montage.create(Component, { } else { this.autoCompleteLabel.classList.remove("disabled"); } + + //hide the zoom hottext if it is code view of a design file + if (this._currentDocument && this._currentDocument.model && this._currentDocument.model.views.design){ + this.zoomHottext.element.style.display = "none"; + } } }, -- cgit v1.2.3