aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/layout.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/js/stage/layout.js b/js/stage/layout.js
index dd5be081..1a491210 100755
--- a/js/stage/layout.js
+++ b/js/stage/layout.js
@@ -58,7 +58,7 @@ exports.Layout = Montage.create(Component, {
58 58
59 this.eventManager.addEventListener("selectionChange", this, false); 59 this.eventManager.addEventListener("selectionChange", this, false);
60 60
61 this.eventManager.addEventListener("deleteSelection", this, true); 61 this.eventManager.addEventListener("deleteSelection", this, false);
62 62
63// this.addEventListener("change@stage.appModel.layoutView", this.handleLayoutView, false); 63// this.addEventListener("change@stage.appModel.layoutView", this.handleLayoutView, false);
64 64
@@ -74,26 +74,23 @@ exports.Layout = Montage.create(Component, {
74 handleElementAdded: { 74 handleElementAdded: {
75 value: function(event) { 75 value: function(event) {
76 this.domTree.push(event.detail); 76 this.domTree.push(event.detail);
77
78 this.draw();
79 this.draw3DInfo(false);
77 } 80 }
78 }, 81 },
79 82
80 handleElementDeleted: { 83 handleElementDeleted: {
81 value: function(event) { 84 value: function(event) {
82 this.domTree.splice(this.domTree.indexOf(event.detail), 1); 85 this.domTree.splice(this.domTree.indexOf(event.detail), 1);
83
84 this.draw();
85 } 86 }
86 }, 87 },
87 88
88 captureDeleteSelection: { 89 // Redraw stage only once after all deletion is completed
90 handleDeleteSelection: {
89 value: function(event) { 91 value: function(event) {
90 //this.redrawDocument(); 92 this.draw();
91 93 this.draw3DInfo(false);
92 var len = event.detail.length;
93 for(var i = 0; i < len ; i++) {
94 this.domTree.splice(this.domTree.indexOf(event.detail[i]),1);
95 }
96
97 } 94 }
98 }, 95 },
99 96