aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-07-19 16:24:17 -0700
committerNivesh Rajbhandari2012-07-19 16:24:17 -0700
commit6db7685f40310683e1cb6c4e98895d2007e787dc (patch)
treee7d0bc8d9363e1d580edac0d2f922de36d10954a
parent71795a786342b3d84ef904dc448b4ce840a44810 (diff)
downloadninja-6db7685f40310683e1cb6c4e98895d2007e787dc.tar.gz
IKNINJA-1899 - Fixed runtime error when undoing a delete shape action.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
-rwxr-xr-xjs/mediators/element-mediator.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 4a4c9f88..f5b574fc 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -69,7 +69,7 @@ exports.ElementMediator = Montage.create(Component, {
69 69
70 var undoLabel = "add element"; 70 var undoLabel = "add element";
71 71
72 document.application.undoManager.add(undoLabel, this.removeElements, this, elements, notify); 72 document.application.undoManager.add(undoLabel, this.removeElements, this, elements, notify, false);
73 73
74 this.application.ninja.currentDocument.model.needsSave = true; 74 this.application.ninja.currentDocument.model.needsSave = true;
75 75
@@ -80,9 +80,10 @@ exports.ElementMediator = Montage.create(Component, {
80 }, 80 },
81 81
82 removeElements:{ 82 removeElements:{
83 value:function (elements, notify /* Used for the add undo */) { 83 value:function (elements, notify, callDeleteDelegate) {
84 84
85 if (this.deleteDelegate && (typeof this.deleteDelegate.handleDelete === 'function')) { 85 if ((callDeleteDelegate || (typeof callDeleteDelegate === "undefined"))
86 && this.deleteDelegate && (typeof this.deleteDelegate.handleDelete === 'function')) {
86 return this.deleteDelegate.handleDelete(); 87 return this.deleteDelegate.handleDelete();
87 // this.handleDelete.call(deleteDelegate); 88 // this.handleDelete.call(deleteDelegate);
88 } 89 }
@@ -98,7 +99,7 @@ exports.ElementMediator = Montage.create(Component, {
98 99
99 var undoLabel = "add element"; 100 var undoLabel = "add element";
100 101
101 document.application.undoManager.add(undoLabel, this.addElements, this, elements, null, notify); 102 document.application.undoManager.add(undoLabel, this.addElements, this, elements, null, notify, false);
102 103
103 this.application.ninja.currentDocument.model.needsSave = true; 104 this.application.ninja.currentDocument.model.needsSave = true;
104 105