aboutsummaryrefslogtreecommitdiff
path: root/js/stage/layout.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-04-04 17:24:27 -0700
committerNivesh Rajbhandari2012-04-04 17:24:27 -0700
commit01cf259da7aaa7d70789d9a7c32111d88b477463 (patch)
tree0bff3395ac681e5f685d2267f7dbc03a8e32bc4a /js/stage/layout.js
parent331ea08655245e3532e48bf160d5f68a04d8723f (diff)
parent13368ca6ebbc13adeafccd898dfffd7ce37cb28a (diff)
downloadninja-01cf259da7aaa7d70789d9a7c32111d88b477463.tar.gz
Merge branch 'refs/heads/ToolFixes' into WebGLMaterials
Conflicts: js/document/templates/montage-html/default_html.css js/mediators/element-mediator.js js/panels/properties.reel/properties.js js/tools/BrushTool.js js/tools/LineTool.js js/tools/PenTool.js js/tools/SelectionTool.js js/tools/ShapeTool.js js/tools/TranslateObject3DTool.js Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/stage/layout.js')
-rwxr-xr-xjs/stage/layout.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/js/stage/layout.js b/js/stage/layout.js
index 2de67538..a096848e 100755
--- a/js/stage/layout.js
+++ b/js/stage/layout.js
@@ -53,12 +53,8 @@ exports.Layout = Montage.create(Component, {
53 this.ctx.lineWidth = this.ctxLineWidth; 53 this.ctx.lineWidth = this.ctxLineWidth;
54 this.ctx.fillStyle = this.drawFillColor; 54 this.ctx.fillStyle = this.drawFillColor;
55 55
56// this.eventManager.addEventListener("elementAdded", this, false);
57 this.eventManager.addEventListener("elementDeleted", this, false);
58
59 this.eventManager.addEventListener("selectionChange", this, false); 56 this.eventManager.addEventListener("selectionChange", this, false);
60 57 this.eventManager.addEventListener("elementsRemoved", this, false);
61 this.eventManager.addEventListener("deleteSelection", this, false);
62 } 58 }
63 }, 59 },
64 60
@@ -76,7 +72,7 @@ exports.Layout = Montage.create(Component, {
76 }, 72 },
77 73
78 // Redraw stage only once after all deletion is completed 74 // Redraw stage only once after all deletion is completed
79 handleDeleteSelection: { 75 handleElementsRemoved: {
80 value: function(event) { 76 value: function(event) {
81 this.draw(); 77 this.draw();
82 this.draw3DInfo(false); 78 this.draw3DInfo(false);
@@ -110,10 +106,8 @@ exports.Layout = Montage.create(Component, {
110 106
111 // Draw the non selected elements 107 // Draw the non selected elements
112 if(!event.detail.isDocument) { 108 if(!event.detail.isDocument) {
113 var tmp = event.detail.elements.map(function(element){ return element._element});
114
115 this.elementsToDraw = this.domTree.filter(function(value) { 109 this.elementsToDraw = this.domTree.filter(function(value) {
116 return (tmp.indexOf(value) === -1); 110 return (event.detail.elements.indexOf(value) === -1);
117 }); 111 });
118 } else { 112 } else {
119 this.elementsToDraw = Array.prototype.slice.call(this.domTree, 0); 113 this.elementsToDraw = Array.prototype.slice.call(this.domTree, 0);
@@ -345,7 +339,11 @@ exports.Layout = Montage.create(Component, {
345 339
346 _elementName: { 340 _elementName: {
347 value: function(item) { 341 value: function(item) {
348 return this.application.ninja.elementMediator.getNJProperty(item, "selection"); 342 if(item.elementModel && item.elementModel.hasOwnProperty("selection")) {
343 return item.elementModel['selection'];
344 } else {
345 return "";
346 }
349 } 347 }
350 } 348 }
351 349