From 854a6d1be334782c8e232601e6d562a11296e55a Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 3 Feb 2012 14:06:26 -0800 Subject: Update grid and planes when elementChange event signifies the "matrix", "left", "top", "width" or "height" properties have changed. Signed-off-by: Nivesh Rajbhandari --- js/stage/layout.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/stage/layout.js') diff --git a/js/stage/layout.js b/js/stage/layout.js index dd5be081..c369fc30 100644 --- a/js/stage/layout.js +++ b/js/stage/layout.js @@ -74,6 +74,9 @@ exports.Layout = Montage.create(Component, { handleElementAdded: { value: function(event) { this.domTree.push(event.detail); + + this.draw(); + this.draw3DInfo(false); } }, @@ -82,6 +85,7 @@ exports.Layout = Montage.create(Component, { this.domTree.splice(this.domTree.indexOf(event.detail), 1); this.draw(); + this.draw3DInfo(false); } }, -- cgit v1.2.3 From d7ad2659d7ef8d0fffbb1cba8218061ebd516dd0 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 3 Feb 2012 15:09:54 -0800 Subject: Handle delete of multiple objects. Also, have deletion go through the mediator so elementDeleted event is fired for SnapManager, DrawUtils, etc. to clean up after deleted element(s). Signed-off-by: Nivesh Rajbhandari --- js/stage/layout.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'js/stage/layout.js') diff --git a/js/stage/layout.js b/js/stage/layout.js index c369fc30..1a491210 100644 --- a/js/stage/layout.js +++ b/js/stage/layout.js @@ -58,7 +58,7 @@ exports.Layout = Montage.create(Component, { this.eventManager.addEventListener("selectionChange", this, false); - this.eventManager.addEventListener("deleteSelection", this, true); + this.eventManager.addEventListener("deleteSelection", this, false); // this.addEventListener("change@stage.appModel.layoutView", this.handleLayoutView, false); @@ -83,21 +83,14 @@ exports.Layout = Montage.create(Component, { handleElementDeleted: { value: function(event) { this.domTree.splice(this.domTree.indexOf(event.detail), 1); - - this.draw(); - this.draw3DInfo(false); } }, - captureDeleteSelection: { + // Redraw stage only once after all deletion is completed + handleDeleteSelection: { value: function(event) { - //this.redrawDocument(); - - var len = event.detail.length; - for(var i = 0; i < len ; i++) { - this.domTree.splice(this.domTree.indexOf(event.detail[i]),1); - } - + this.draw(); + this.draw3DInfo(false); } }, -- cgit v1.2.3