aboutsummaryrefslogtreecommitdiff
path: root/js/mediators
diff options
context:
space:
mode:
authorAnanya Sen2012-02-17 11:35:49 -0800
committerAnanya Sen2012-02-17 11:35:49 -0800
commit2ef2ad33ff3f6ee1afd1e2a5c3189278f8fd46f4 (patch)
tree3c4230e9b8250ab5ac9f9173d32a04d5c056dbb6 /js/mediators
parent3b862fe489a3320882f91ab56781fc5dc400c3d1 (diff)
downloadninja-2ef2ad33ff3f6ee1afd1e2a5c3189278f8fd46f4.tar.gz
mark document on setting color, properties and stroke.
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/mediators')
-rwxr-xr-xjs/mediators/element-mediator.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index e1eadda9..ad01fe2d 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -189,6 +189,8 @@ exports.ElementMediator = Montage.create(NJComponent, {
189 NJUtils.makeElementModel(el, "Canvas", "block", true); 189 NJUtils.makeElementModel(el, "Canvas", "block", true);
190 } 190 }
191 191
192 this.application.ninja.documentController.activeDocument.dirtyFlag = true;
193
192 return el.elementModel.controller["setShapeProperty"](el, prop, value); 194 return el.elementModel.controller["setShapeProperty"](el, prop, value);
193 } 195 }
194 }, 196 },
@@ -256,6 +258,8 @@ exports.ElementMediator = Montage.create(NJComponent, {
256 258
257 item.elementModel.controller["setAttribute"](item, att, value); 259 item.elementModel.controller["setAttribute"](item, att, value);
258 260
261 this.application.ninja.documentController.activeDocument.dirtyFlag = true;
262
259 NJevent("attribute" + eventType, {type : "setAttribute", source: source, data: {"els": el, "prop": att, "value": value}, redraw: null}); 263 NJevent("attribute" + eventType, {type : "setAttribute", source: source, data: {"els": el, "prop": att, "value": value}, redraw: null});
260 } 264 }
261 }, 265 },
@@ -328,6 +332,8 @@ exports.ElementMediator = Montage.create(NJComponent, {
328 el.elementModel.controller["setProperty"](el, p, value[i]); 332 el.elementModel.controller["setProperty"](el, p, value[i]);
329 } 333 }
330 334
335 this.application.ninja.documentController.activeDocument.dirtyFlag = true;
336
331 NJevent("element" + eventType, {type : "setProperty", source: source, data: {"els": els, "prop": p, "value": value}, redraw: null}); 337 NJevent("element" + eventType, {type : "setProperty", source: source, data: {"els": els, "prop": p, "value": value}, redraw: null});
332 } 338 }
333 }, 339 },
@@ -387,6 +393,8 @@ exports.ElementMediator = Montage.create(NJComponent, {
387 el.elementModel.controller["setProperties"](el, props, i); 393 el.elementModel.controller["setProperties"](el, props, i);
388 } 394 }
389 395
396 this.application.ninja.documentController.activeDocument.dirtyFlag = true;
397
390 NJevent("element" + eventType, {type : "setProperties", source: source, data: {"els": els, "prop": props, "value": props}, redraw: null}); 398 NJevent("element" + eventType, {type : "setProperties", source: source, data: {"els": els, "prop": props, "value": props}, redraw: null});
391 } 399 }
392 }, 400 },
@@ -459,6 +467,8 @@ exports.ElementMediator = Montage.create(NJComponent, {
459 el.elementModel.controller["set3DProperties"](el, props, i, update3DModel); 467 el.elementModel.controller["set3DProperties"](el, props, i, update3DModel);
460 } 468 }
461 469
470 this.application.ninja.documentController.activeDocument.dirtyFlag = true;
471
462 NJevent("element" + eventType, {type : "set3DProperties", source: source, data: {"els": els, "prop": "matrix", "value": props}, redraw: null}); 472 NJevent("element" + eventType, {type : "set3DProperties", source: source, data: {"els": els, "prop": "matrix", "value": props}, redraw: null});
463 } 473 }
464 }, 474 },
@@ -543,6 +553,8 @@ exports.ElementMediator = Montage.create(NJComponent, {
543 el.elementModel.controller["setColor"](el, value, isFill); 553 el.elementModel.controller["setColor"](el, value, isFill);
544 } 554 }
545 555
556 this.application.ninja.documentController.activeDocument.dirtyFlag = true;
557
546 NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null}); 558 NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null});
547 } 559 }
548 }, 560 },
@@ -624,6 +636,8 @@ exports.ElementMediator = Montage.create(NJComponent, {
624 el.elementModel.controller["setStroke"](el, value); 636 el.elementModel.controller["setStroke"](el, value);
625 } 637 }
626 638
639 this.application.ninja.documentController.activeDocument.dirtyFlag = true;
640
627 NJevent("element" + eventType, {type : "setStroke", source: source, data: {"els": els, "prop": "stroke", "value": value}, redraw: null}); 641 NJevent("element" + eventType, {type : "setStroke", source: source, data: {"els": els, "prop": "stroke", "value": value}, redraw: null});
628 } 642 }
629 }, 643 },
@@ -698,6 +712,8 @@ exports.ElementMediator = Montage.create(NJComponent, {
698 } 712 }
699 else 713 else
700 { 714 {
715 this.application.ninja.documentController.activeDocument.dirtyFlag = true;
716
701 NJevent("elementChange", {type : "setMatrix", source: null, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null}); 717 NJevent("elementChange", {type : "setMatrix", source: null, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null});
702 } 718 }
703 } 719 }