From 8cd6c76aabb4c75ab63f8d46b7e89bddbcbfe2a7 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 19 Apr 2012 10:38:43 -0700 Subject: - fixed the text cursor - code cleanup Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.css | 2 +- js/stage/stage-view.reel/stage-view.js | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage-view.reel/stage-view.css b/js/stage/stage-view.reel/stage-view.css index a7e255ae..4cf5b2ab 100755 --- a/js/stage/stage-view.reel/stage-view.css +++ b/js/stage/stage-view.reel/stage-view.css @@ -14,7 +14,7 @@ width: 100%; height: 100%; overflow:auto; - /*display: none;*/ + cursor:text; } /* OLD CSS for reference diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index bc8b469c..53eff90e 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -94,14 +94,13 @@ exports.StageView = Montage.create(Component, { doc.editor = this.application.ninja.codeEditorController.createEditor(doc, type); doc.editor.hline = doc.editor.setLineClass(0, "activeline"); - this.showCodeViewBar(true); - - this.application.ninja.codeEditorController.handleCodeCompletionSupport(type); - this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe this.application.ninja.documentController.activeDocument = doc; this.application.ninja.stage.hideCanvas(true); document.getElementById("iframeContainer").style.display="none";//hide the iframe when switching to code view + + this.showCodeViewBar(true); + this.application.ninja.codeEditorController.applySettings(); this.collapseAllPanels(); } }, @@ -117,11 +116,6 @@ exports.StageView = Montage.create(Component, { if(this.application.ninja.documentController.activeDocument.currentView === "design") { this.application.ninja.currentDocument = this.application.ninja.documentController.activeDocument; - - this.showCodeViewBar(false); - }else{ - this.showCodeViewBar(true); - this.application.ninja.codeEditorController.handleCodeCompletionSupport(this.application.ninja.documentController.activeDocument.editor.getOption("mode")); } this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe @@ -129,13 +123,17 @@ exports.StageView = Montage.create(Component, { //focus editor if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.editor.focus(); - this.application.ninja.codeEditorController.handleThemeSelection(); + + this.showCodeViewBar(true); + this.application.ninja.codeEditorController.applySettings(); this.collapseAllPanels(); } if(this.application.ninja.documentController.activeDocument.currentView === "design") { this.application.ninja.stage._scrollFlag = true; // TODO HACK to prevent type error on Hide/Show Iframe this.application.ninja.stage.stageDeps.reinitializeForSwitchDocument();//reinitialize draw-util, snapmanager and view-util + + this.showCodeViewBar(false); this.restoreAllPanels(); } -- cgit v1.2.3