diff options
author | Jose Antonio Marquez | 2012-05-24 11:38:51 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-24 11:38:51 -0700 |
commit | e64328dc08418730ca580d33381cb2001c7a96fd (patch) | |
tree | 74e3996696adfea94158c29575e9393e56169930 /js/controllers | |
parent | d57cd68741f340a45be780675ed79b5caf2094e9 (diff) | |
parent | a8eb5c65a21af3bf8d8b8eb3e65b494b8bd9bc01 (diff) | |
download | ninja-e64328dc08418730ca580d33381cb2001c7a96fd.tar.gz |
Merge branch 'refs/heads/Ninja-DOM-Architecture' into Document
Conflicts:
js/document/document-html.js
js/helper-classes/3D/view-utils.js
js/stage/stage.reel/stage.js
Diffstat (limited to 'js/controllers')
-rwxr-xr-x | js/controllers/document-controller.js | 18 | ||||
-rwxr-xr-x | js/controllers/selection-controller.js | 5 | ||||
-rwxr-xr-x | js/controllers/styles-controller.js | 2 |
3 files changed, 13 insertions, 12 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index eecf9146..2c34eedf 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -377,10 +377,10 @@ exports.DocumentController = Montage.create(Component, { | |||
377 | 377 | ||
378 | if(this._documents.length > 0) { | 378 | if(this._documents.length > 0) { |
379 | previousFocusedDocument = this._documents[this._documents.length - 1]; | 379 | previousFocusedDocument = this._documents[this._documents.length - 1]; |
380 | this._activeDocument = previousFocusedDocument; | 380 | this.activeDocument = previousFocusedDocument; |
381 | this.switchDocuments(this.activeDocument, previousFocusedDocument, true); | 381 | this.switchDocuments(this.activeDocument, previousFocusedDocument, false); |
382 | } else { | 382 | } else { |
383 | this._activeDocument = null; | 383 | this.activeDocument = null; |
384 | this.application.ninja.stage.hideRulers(); | 384 | this.application.ninja.stage.hideRulers(); |
385 | 385 | ||
386 | this.application.ninja.stage.hideCanvas(true); | 386 | this.application.ninja.stage.hideCanvas(true); |
@@ -502,14 +502,16 @@ exports.DocumentController = Montage.create(Component, { | |||
502 | this.application.ninja.stage.restoreAllPanels(); | 502 | this.application.ninja.stage.restoreAllPanels(); |
503 | this.application.ninja.stage.hideCanvas(false); | 503 | this.application.ninja.stage.hideCanvas(false); |
504 | this.application.ninja.stage.showRulers(); | 504 | this.application.ninja.stage.showRulers(); |
505 | } else if(currentDocument.currentView === "design" && newDocument.currentView === "code") { | ||
506 | this.application.ninja.stage.showCodeViewBar(true); | ||
507 | this.application.ninja.stage.collapseAllPanels(); | ||
508 | this.application.ninja.stage.hideCanvas(true); | ||
509 | this.application.ninja.stage.hideRulers(); | ||
510 | } | 505 | } |
511 | } | 506 | } |
512 | 507 | ||
508 | if(newDocument.currentView === "code") { | ||
509 | this.application.ninja.stage.showCodeViewBar(true); | ||
510 | this.application.ninja.stage.collapseAllPanels(); | ||
511 | this.application.ninja.stage.hideCanvas(true); | ||
512 | this.application.ninja.stage.hideRulers(); | ||
513 | } | ||
514 | |||
513 | this.application.ninja.stage.clearAllCanvas(); | 515 | this.application.ninja.stage.clearAllCanvas(); |
514 | 516 | ||
515 | if(didCreate) { | 517 | if(didCreate) { |
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 7bef0db8..75bffc5c 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js | |||
@@ -67,10 +67,9 @@ exports.SelectionController = Montage.create(Component, { | |||
67 | this._isDocument = true; | 67 | this._isDocument = true; |
68 | 68 | ||
69 | if(currentSelectionArray) { | 69 | if(currentSelectionArray) { |
70 | if(currentSelectionArray.length >= 1) { | 70 | this.application.ninja.selectedElements = currentSelectionArray; |
71 | if(currentSelectionArray.length) { | ||
71 | this._isDocument = false; | 72 | this._isDocument = false; |
72 | |||
73 | this.application.ninja.selectedElements = currentSelectionArray; | ||
74 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); | 73 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); |
75 | } | 74 | } |
76 | } | 75 | } |
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 04e87ba7..534f77c7 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; |