aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/selection-controller.js4
-rwxr-xr-xjs/controllers/styles-controller.js2
-rwxr-xr-xjs/panels/Panel.reel/Panel.js13
-rwxr-xr-xjs/stage/layout.js2
4 files changed, 17 insertions, 4 deletions
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, {
58 return; 58 return;
59 } 59 }
60 60
61 if(this._currentDocument && this._currentDocument.currentView === "design") { 61 if(this._currentDocument && (this._currentDocument.currentView === "design" || this._currentDocument.model.currentView.identifier !== "code")) {
62 this._currentDocument.model._selection = this.application.ninja.selectedElements; 62 this._currentDocument.model._selection = this.application.ninja.selectedElements;
63 } 63 }
64 64
65 this._currentDocument = value; 65 this._currentDocument = value;
66 66
67 if(this._currentDocument && this._currentDocument.currentView === "design") { 67 if(this._currentDocument && (this._currentDocument.currentView === "design" || this._currentDocument.model.currentView.identifier !== "code")) {
68 this.selectedElements = this._currentDocument.model.selection; 68 this.selectedElements = this._currentDocument.model.selection;
69 } 69 }
70 /* 70 /*
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, {
87 set : function(document) { 87 set : function(document) {
88 ///// If the document is null set default stylesheets to null 88 ///// If the document is null set default stylesheets to null
89 89
90 if(!document || document.currentView === "code") { 90 if(!document || (document.currentView === "code" && document.model.currentView.identifier !== "design-code")) {
91 this._currentDocument = null; 91 this._currentDocument = null;
92 this._stageStylesheet = null; 92 this._stageStylesheet = null;
93 this.defaultStylesheet = null; 93 this.defaultStylesheet = null;
diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js
index 988088e3..586636e1 100755
--- a/js/panels/Panel.reel/Panel.js
+++ b/js/panels/Panel.reel/Panel.js
@@ -159,11 +159,24 @@ exports.Panel = Montage.create(Component, {
159 this.disabled = true; 159 this.disabled = true;
160 } else { 160 } else {
161 this.disabled = this._currentDocument.currentView !== "design"; 161 this.disabled = this._currentDocument.currentView !== "design";
162 this._currentDocument.addPropertyChangeListener("model.currentViewIdentifier", this, false);
162 } 163 }
163 164
164 } 165 }
165 }, 166 },
166 167
168 handleChange: {
169 value: function(notification) {
170 if(notification.currentPropertyPath === "model.currentViewIdentifier") {
171 if(this.currentDocument.model.currentView.identifier === "design-code") {
172 this.disabled = true;
173 } else {
174 this.disabled = false;
175 }
176 }
177 }
178 },
179
167 handleBtnCollapseAction: { 180 handleBtnCollapseAction: {
168 value: function() { 181 value: function() {
169 this.collapsed = !this.collapsed; 182 this.collapsed = !this.collapsed;
diff --git a/js/stage/layout.js b/js/stage/layout.js
index 5cc8dbea..5e6e8152 100755
--- a/js/stage/layout.js
+++ b/js/stage/layout.js
@@ -69,7 +69,7 @@ exports.Layout = Montage.create(Component, {
69 set : function(value) { 69 set : function(value) {
70 if (value !== this._currentDocument) { 70 if (value !== this._currentDocument) {
71 this._currentDocument = value; 71 this._currentDocument = value;
72 if(this._currentDocument && this._currentDocument.currentView === "design") { 72 if(this._currentDocument && (this._currentDocument.currentView === "design" || this._currentDocument.model.currentView.identifier !== "code")) {
73 this.elementsToDraw = Array.prototype.slice.call(this._currentDocument.model.documentRoot.childNodes, 0); 73 this.elementsToDraw = Array.prototype.slice.call(this._currentDocument.model.documentRoot.childNodes, 0);
74 } 74 }
75 } 75 }