aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-23 15:24:25 -0700
committerValerio Virgillito2012-05-23 15:26:54 -0700
commitd5b36812ba84e49aa8b597eea9f75bf36ddcb571 (patch)
tree4d5807d9723452f860b46f7413adff1828c68820 /js/controllers
parent1a7e347810401e6262d9d7bad1c3583e6773993b (diff)
downloadninja-d5b36812ba84e49aa8b597eea9f75bf36ddcb571.tar.gz
fixing the styles manager to open code view files and closing the last document.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
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;