aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/document-controller.js15
-rwxr-xr-xjs/controllers/styles-controller.js2
2 files changed, 7 insertions, 10 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 3e15511d..aa037bd4 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -399,10 +399,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
399 399
400 if(this._documents.length > 0) { 400 if(this._documents.length > 0) {
401 previousFocusedDocument = this._documents[this._documents.length - 1]; 401 previousFocusedDocument = this._documents[this._documents.length - 1];
402 this._activeDocument = previousFocusedDocument; 402 this.activeDocument = previousFocusedDocument;
403 this.switchDocuments(this.activeDocument, previousFocusedDocument, true); 403 this.switchDocuments(this.activeDocument, previousFocusedDocument, false);
404 } else { 404 } else {
405 this._activeDocument = null; 405 this.activeDocument = null;
406 this.application.ninja.stage.hideRulers(); 406 this.application.ninja.stage.hideRulers();
407 407
408 this.application.ninja.stage.hideCanvas(true); 408 this.application.ninja.stage.hideCanvas(true);
@@ -524,13 +524,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
524 this.application.ninja.stage.restoreAllPanels(); 524 this.application.ninja.stage.restoreAllPanels();
525 this.application.ninja.stage.hideCanvas(false); 525 this.application.ninja.stage.hideCanvas(false);
526 this.application.ninja.stage.showRulers(); 526 this.application.ninja.stage.showRulers();
527 } else if(currentDocument.currentView === "design" && newDocument.currentView === "code") {
528 this.application.ninja.stage.showCodeViewBar(true);
529 this.application.ninja.stage.collapseAllPanels();
530 this.application.ninja.stage.hideCanvas(true);
531 this.application.ninja.stage.hideRulers();
532 } 527 }
533 }else if(!currentDocument && newDocument.currentView === "code"){ 528 }
529
530 if(newDocument.currentView === "code") {
534 this.application.ninja.stage.showCodeViewBar(true); 531 this.application.ninja.stage.showCodeViewBar(true);
535 this.application.ninja.stage.collapseAllPanels(); 532 this.application.ninja.stage.collapseAllPanels();
536 this.application.ninja.stage.hideCanvas(true); 533 this.application.ninja.stage.hideCanvas(true);
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js
index dcbe0eaf..8ceb9774 100755
--- a/js/controllers/styles-controller.js
+++ b/js/controllers/styles-controller.js
@@ -81,7 +81,7 @@ var stylesController = exports.StylesController = Montage.create(Component, {
81 set : function(document) { 81 set : function(document) {
82 ///// If the document is null set default stylesheets to null 82 ///// If the document is null set default stylesheets to null
83 83
84 if(!document) { 84 if(!document || document.currentView === "code") {
85 this._activeDocument = null; 85 this._activeDocument = null;
86 this._stageStylesheet = null; 86 this._stageStylesheet = null;
87 this.defaultStylesheet = null; 87 this.defaultStylesheet = null;