aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/document-controller.js6
-rwxr-xr-xjs/controllers/elements/element-controller.js6
-rwxr-xr-xjs/controllers/selection-controller.js9
3 files changed, 17 insertions, 4 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index d5d0cf42..e221df68 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -339,7 +339,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
339 // Event Detail: Contains the current ActiveDocument 339 // Event Detail: Contains the current ActiveDocument
340 _onOpenDocument: { 340 _onOpenDocument: {
341 value: function(doc){ 341 value: function(doc){
342 //var data = DocumentManager.activeDocument; 342 this.application.ninja.currentDocument = doc;
343 this._hideCurrentDocument(); 343 this._hideCurrentDocument();
344 this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid); 344 this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid);
345 345
@@ -423,7 +423,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
423 value: function() { 423 value: function() {
424 if(this.activeDocument) { 424 if(this.activeDocument) {
425 if(this.activeDocument.currentView === "design"){ 425 if(this.activeDocument.currentView === "design"){
426 this.application.ninja.stage.saveScroll(); 426 this.activeDocument.saveAppState();
427 this.activeDocument.container.parentNode.style["display"] = "none"; 427 this.activeDocument.container.parentNode.style["display"] = "none";
428 this.application.ninja.stage.hideCanvas(true); 428 this.application.ninja.stage.hideCanvas(true);
429 this.application.ninja.stage.stageView.hideRulers(); 429 this.application.ninja.stage.stageView.hideRulers();
@@ -440,7 +440,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
440 this.activeDocument.container.style["display"] = "block"; 440 this.activeDocument.container.style["display"] = "block";
441 if(this.activeDocument.currentView === "design"){ 441 if(this.activeDocument.currentView === "design"){
442 this.activeDocument.container.parentNode.style["display"] = "block"; 442 this.activeDocument.container.parentNode.style["display"] = "block";
443 this.application.ninja.stage.restoreScroll(); 443 this.activeDocument.restoreAppState();
444 this.application.ninja.stage.hideCanvas(false); 444 this.application.ninja.stage.hideCanvas(false);
445 this.application.ninja.stage.stageView.showRulers(); 445 this.application.ninja.stage.stageView.showRulers();
446 }else{ 446 }else{
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 46e82ace..ec0335b4 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -27,7 +27,11 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
27 27
28 getProperty: { 28 getProperty: {
29 value: function(el, prop, fallbackOnComputed, isStageElement) { 29 value: function(el, prop, fallbackOnComputed, isStageElement) {
30 return this.application.ninja.stylesController.getElementStyle(el, prop, fallbackOnComputed, isStageElement); 30 if(el.nodeType !== 3){
31 return this.application.ninja.stylesController.getElementStyle(el, prop, fallbackOnComputed, isStageElement);
32 }else{
33 return null;
34 }
31 } 35 }
32 }, 36 },
33 37
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index d69b53e0..f50762f3 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -58,6 +58,7 @@ exports.SelectionController = Montage.create(Component, {
58 handleOpenDocument: { 58 handleOpenDocument: {
59 value: function() { 59 value: function() {
60 // Handle initializing the selection array here. 60 // Handle initializing the selection array here.
61 this.initWithDocument([]);
61 } 62 }
62 }, 63 },
63 64
@@ -70,6 +71,14 @@ exports.SelectionController = Montage.create(Component, {
70 if(currentSelectionArray.length >= 1) { 71 if(currentSelectionArray.length >= 1) {
71 this._selectedItems = currentSelectionArray; 72 this._selectedItems = currentSelectionArray;
72 this._isDocument = false; 73 this._isDocument = false;
74
75
76
77 this.application.ninja.selectedElements = currentSelectionArray;
78 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
79
80
81
73 } 82 }
74 } 83 }
75 84