diff options
author | Ananya Sen | 2012-02-17 12:39:12 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-17 12:39:12 -0800 |
commit | a7e3ef9f80d5e29515c9f8dd5374c89b9d2496de (patch) | |
tree | 2591ad36881f60b6ba1acc4c2ca11672fd4531f0 /js/mediators | |
parent | 2ef2ad33ff3f6ee1afd1e2a5c3189278f8fd46f4 (diff) | |
download | ninja-a7e3ef9f80d5e29515c9f8dd5374c89b9d2496de.tar.gz |
use method to update dirtyFlag
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/mediators')
-rwxr-xr-x | js/mediators/element-mediator.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index ad01fe2d..559cb44c 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -102,7 +102,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
102 | el.elementModel.controller["set3DProperties"](el, [p3d], 0, true); | 102 | el.elementModel.controller["set3DProperties"](el, [p3d], 0, true); |
103 | } | 103 | } |
104 | if(!noEvent) { | 104 | if(!noEvent) { |
105 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 105 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
106 | NJevent("elementAdded", el); | 106 | NJevent("elementAdded", el); |
107 | } | 107 | } |
108 | } | 108 | } |
@@ -130,7 +130,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
130 | _removeElement: { | 130 | _removeElement: { |
131 | value: function(el, rules) { | 131 | value: function(el, rules) { |
132 | ElementController.removeElement(el, rules); | 132 | ElementController.removeElement(el, rules); |
133 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 133 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
134 | NJevent("elementDeleted", el); | 134 | NJevent("elementDeleted", el); |
135 | } | 135 | } |
136 | }, | 136 | }, |
@@ -189,7 +189,7 @@ 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; | 192 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
193 | 193 | ||
194 | return el.elementModel.controller["setShapeProperty"](el, prop, value); | 194 | return el.elementModel.controller["setShapeProperty"](el, prop, value); |
195 | } | 195 | } |
@@ -258,7 +258,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
258 | 258 | ||
259 | item.elementModel.controller["setAttribute"](item, att, value); | 259 | item.elementModel.controller["setAttribute"](item, att, value); |
260 | 260 | ||
261 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 261 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
262 | 262 | ||
263 | 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}); |
264 | } | 264 | } |
@@ -332,7 +332,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
332 | el.elementModel.controller["setProperty"](el, p, value[i]); | 332 | el.elementModel.controller["setProperty"](el, p, value[i]); |
333 | } | 333 | } |
334 | 334 | ||
335 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 335 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
336 | 336 | ||
337 | 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}); |
338 | } | 338 | } |
@@ -393,7 +393,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
393 | el.elementModel.controller["setProperties"](el, props, i); | 393 | el.elementModel.controller["setProperties"](el, props, i); |
394 | } | 394 | } |
395 | 395 | ||
396 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 396 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
397 | 397 | ||
398 | 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}); |
399 | } | 399 | } |
@@ -467,7 +467,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
467 | el.elementModel.controller["set3DProperties"](el, props, i, update3DModel); | 467 | el.elementModel.controller["set3DProperties"](el, props, i, update3DModel); |
468 | } | 468 | } |
469 | 469 | ||
470 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 470 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
471 | 471 | ||
472 | 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}); |
473 | } | 473 | } |
@@ -553,7 +553,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
553 | el.elementModel.controller["setColor"](el, value, isFill); | 553 | el.elementModel.controller["setColor"](el, value, isFill); |
554 | } | 554 | } |
555 | 555 | ||
556 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 556 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
557 | 557 | ||
558 | 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}); |
559 | } | 559 | } |
@@ -636,7 +636,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
636 | el.elementModel.controller["setStroke"](el, value); | 636 | el.elementModel.controller["setStroke"](el, value); |
637 | } | 637 | } |
638 | 638 | ||
639 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 639 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
640 | 640 | ||
641 | 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}); |
642 | } | 642 | } |
@@ -712,7 +712,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
712 | } | 712 | } |
713 | else | 713 | else |
714 | { | 714 | { |
715 | this.application.ninja.documentController.activeDocument.dirtyFlag = true; | 715 | this.application.ninja.documentController.activeDocument.markDocumentEditted(); |
716 | 716 | ||
717 | 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}); |
718 | } | 718 | } |