From 7e615eaa90c7bd7a4da15ce04eb089aa3367e389 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 1 Aug 2012 23:36:13 -0700 Subject: fixing a few issues when switching between code view documents Signed-off-by: Valerio Virgillito --- js/controllers/selection-controller.js | 4 ++-- js/controllers/styles-controller.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 7a26ed3b..4b031d70 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -58,13 +58,13 @@ exports.SelectionController = Montage.create(Component, { return; } - if(this._currentDocument && this._currentDocument.currentView === "design") { + if(this._currentDocument && (this._currentDocument.currentView === "design" || this._currentDocument.model.currentView.identifier !== "code")) { this._currentDocument.model._selection = this.application.ninja.selectedElements; } this._currentDocument = value; - if(this._currentDocument && this._currentDocument.currentView === "design") { + if(this._currentDocument && (this._currentDocument.currentView === "design" || this._currentDocument.model.currentView.identifier !== "code")) { this.selectedElements = this._currentDocument.model.selection; } /* diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index e95c6614..68d031fb 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -87,7 +87,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { set : function(document) { ///// If the document is null set default stylesheets to null - if(!document || document.currentView === "code") { + if(!document || (document.currentView === "code" && document.model.currentView.identifier !== "design-code")) { this._currentDocument = null; this._stageStylesheet = null; this.defaultStylesheet = null; -- cgit v1.2.3