diff options
Diffstat (limited to 'js/controllers')
-rwxr-xr-x | js/controllers/document-controller.js | 6 | ||||
-rwxr-xr-x | js/controllers/elements/element-controller.js | 6 | ||||
-rwxr-xr-x | js/controllers/selection-controller.js | 9 |
3 files changed, 17 insertions, 4 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 3a77ed5f..6f7d098f 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -335,7 +335,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
335 | // Event Detail: Contains the current ActiveDocument | 335 | // Event Detail: Contains the current ActiveDocument |
336 | _onOpenDocument: { | 336 | _onOpenDocument: { |
337 | value: function(doc){ | 337 | value: function(doc){ |
338 | //var data = DocumentManager.activeDocument; | 338 | this.application.ninja.currentDocument = doc; |
339 | this._hideCurrentDocument(); | 339 | this._hideCurrentDocument(); |
340 | this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid); | 340 | this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid); |
341 | 341 | ||
@@ -419,7 +419,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
419 | value: function() { | 419 | value: function() { |
420 | if(this.activeDocument) { | 420 | if(this.activeDocument) { |
421 | if(this.activeDocument.currentView === "design"){ | 421 | if(this.activeDocument.currentView === "design"){ |
422 | this.application.ninja.stage.saveScroll(); | 422 | this.activeDocument.saveAppState(); |
423 | this.activeDocument.container.parentNode.style["display"] = "none"; | 423 | this.activeDocument.container.parentNode.style["display"] = "none"; |
424 | this.application.ninja.stage.hideCanvas(true); | 424 | this.application.ninja.stage.hideCanvas(true); |
425 | this.application.ninja.stage.stageView.hideRulers(); | 425 | this.application.ninja.stage.stageView.hideRulers(); |
@@ -436,7 +436,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
436 | this.activeDocument.container.style["display"] = "block"; | 436 | this.activeDocument.container.style["display"] = "block"; |
437 | if(this.activeDocument.currentView === "design"){ | 437 | if(this.activeDocument.currentView === "design"){ |
438 | this.activeDocument.container.parentNode.style["display"] = "block"; | 438 | this.activeDocument.container.parentNode.style["display"] = "block"; |
439 | this.application.ninja.stage.restoreScroll(); | 439 | this.activeDocument.restoreAppState(); |
440 | this.application.ninja.stage.hideCanvas(false); | 440 | this.application.ninja.stage.hideCanvas(false); |
441 | this.application.ninja.stage.stageView.showRulers(); | 441 | this.application.ninja.stage.stageView.showRulers(); |
442 | }else{ | 442 | }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 | ||