aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/controllers/selection-controller.js9
-rwxr-xr-xjs/document/html-document.js6
-rwxr-xr-xjs/panels/properties/content.reel/content.js10
3 files changed, 22 insertions, 3 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index f50762f3..62313960 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -47,6 +47,7 @@ exports.SelectionController = Montage.create(Component, {
47 this.eventManager.addEventListener("elementDeleted", this, false); 47 this.eventManager.addEventListener("elementDeleted", this, false);
48 this.eventManager.addEventListener("selectAll", this, false); 48 this.eventManager.addEventListener("selectAll", this, false);
49 this.eventManager.addEventListener("deleteSelection", this, false); 49 this.eventManager.addEventListener("deleteSelection", this, false);
50 this.eventManager.addEventListener("switchDocument", this, false);
50// defaultEventManager.addEventListener( "undo", this, false); 51// defaultEventManager.addEventListener( "undo", this, false);
51// defaultEventManager.addEventListener( "redo", this, false); 52// defaultEventManager.addEventListener( "redo", this, false);
52 } 53 }
@@ -88,6 +89,14 @@ exports.SelectionController = Montage.create(Component, {
88 } 89 }
89 }, 90 },
90 91
92 handleSwitchDocument: {
93 value: function() {
94 this._selectedItems = this.application.ninja.selectedElements.slice(0);
95 this._isDocument = false;
96 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
97 }
98 },
99
91 handleElementAdded: { 100 handleElementAdded: {
92 value: function(event) { 101 value: function(event) {
93 this.executeSelectElement(event.detail); 102 this.executeSelectElement(event.detail);
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 75628731..0e74914a 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -677,7 +677,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
677 this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; 677 this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing;
678 678
679 if(typeof this.application.ninja.selectedElements !== 'undefined'){ 679 if(typeof this.application.ninja.selectedElements !== 'undefined'){
680 this.selectionModel = this.application.ninja.selectedElements; 680 this.selectionModel = this.application.ninja.selectedElements.slice(0);
681 } 681 }
682 682
683 this.draw3DGrid = this.application.ninja.appModel.show3dGrid; 683 this.draw3DGrid = this.application.ninja.appModel.show3dGrid;
@@ -691,8 +691,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
691 this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing; 691 this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing;
692 this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; 692 this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing;
693 693
694 if((typeof this.selectionModel !== 'undefined') && (this.selectionModel !== null) && (this.selectionModel.length > 0)){ 694 if((typeof this.selectionModel !== 'undefined') && (this.selectionModel !== null)){
695 this.application.ninja.selectionController.initWithDocument(this.selectionModel); 695 this.application.ninja.selectedElements = this.selectionModel.slice(0);
696 } 696 }
697 697
698 if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){ 698 if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js
index 8fa33a75..9b9b7108 100755
--- a/js/panels/properties/content.reel/content.js
+++ b/js/panels/properties/content.reel/content.js
@@ -55,6 +55,7 @@ exports.Content = Montage.create(Component, {
55 } 55 }
56 56
57 this.eventManager.addEventListener("openDocument", this, false); 57 this.eventManager.addEventListener("openDocument", this, false);
58 this.eventManager.addEventListener("switchDocument", this, false);
58 } 59 }
59 }, 60 },
60 61
@@ -74,6 +75,15 @@ exports.Content = Montage.create(Component, {
74 } 75 }
75 }, 76 },
76 77
78 handleSwitchDocument: {
79 value: function(){
80 // For now always assume that the stage is selected by default
81 if(this.application.ninja.selectedElements.length === 0) {
82 this.displayStageProperties();
83 }
84 }
85 },
86
77 /** 87 /**
78 * Blur and Key up to handle change in the Element ID field. 88 * Blur and Key up to handle change in the Element ID field.
79 */ 89 */