From ea4385add0e9087487ccded929c2d6674d326db8 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 18 Apr 2012 00:29:52 -0700 Subject: - collapse panels for code view, restore for design view - apply theme selection to all code view documents Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'js/stage/stage-view.reel') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index c06ad988..bc8b469c 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -102,6 +102,7 @@ exports.StageView = Montage.create(Component, { 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.collapseAllPanels(); } }, @@ -128,11 +129,14 @@ 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.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.restoreAllPanels(); } NJevent("switchDocument"); @@ -182,5 +186,22 @@ exports.StageView = Montage.create(Component, { this.application.ninja.editorViewOptions.element.style.display = "none"; } } + }, + + collapseAllPanels:{ + value:function(){ + this.application.ninja.panelSplitter.collapse(); + this.application.ninja.timelineSplitter.collapse(); + this.application.ninja.toolsSplitter.collapse(); + this.application.ninja.optionsSplitter.collapse(); + } + }, + restoreAllPanels:{ + value:function(){ + this.application.ninja.panelSplitter.restore(); + this.application.ninja.timelineSplitter.restore(); + this.application.ninja.toolsSplitter.restore(); + this.application.ninja.optionsSplitter.restore(); + } } }); \ No newline at end of file -- cgit v1.2.3