From 2ef2ad33ff3f6ee1afd1e2a5c3189278f8fd46f4 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 17 Feb 2012 11:35:49 -0800 Subject: mark document on setting color, properties and stroke. Signed-off-by: Ananya Sen --- js/mediators/element-mediator.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js') 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, { NJUtils.makeElementModel(el, "Canvas", "block", true); } + this.application.ninja.documentController.activeDocument.dirtyFlag = true; + return el.elementModel.controller["setShapeProperty"](el, prop, value); } }, @@ -256,6 +258,8 @@ exports.ElementMediator = Montage.create(NJComponent, { item.elementModel.controller["setAttribute"](item, att, value); + this.application.ninja.documentController.activeDocument.dirtyFlag = true; + NJevent("attribute" + eventType, {type : "setAttribute", source: source, data: {"els": el, "prop": att, "value": value}, redraw: null}); } }, @@ -328,6 +332,8 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["setProperty"](el, p, value[i]); } + this.application.ninja.documentController.activeDocument.dirtyFlag = true; + NJevent("element" + eventType, {type : "setProperty", source: source, data: {"els": els, "prop": p, "value": value}, redraw: null}); } }, @@ -387,6 +393,8 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["setProperties"](el, props, i); } + this.application.ninja.documentController.activeDocument.dirtyFlag = true; + NJevent("element" + eventType, {type : "setProperties", source: source, data: {"els": els, "prop": props, "value": props}, redraw: null}); } }, @@ -459,6 +467,8 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["set3DProperties"](el, props, i, update3DModel); } + this.application.ninja.documentController.activeDocument.dirtyFlag = true; + NJevent("element" + eventType, {type : "set3DProperties", source: source, data: {"els": els, "prop": "matrix", "value": props}, redraw: null}); } }, @@ -543,6 +553,8 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["setColor"](el, value, isFill); } + this.application.ninja.documentController.activeDocument.dirtyFlag = true; + NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null}); } }, @@ -624,6 +636,8 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["setStroke"](el, value); } + this.application.ninja.documentController.activeDocument.dirtyFlag = true; + NJevent("element" + eventType, {type : "setStroke", source: source, data: {"els": els, "prop": "stroke", "value": value}, redraw: null}); } }, @@ -698,6 +712,8 @@ exports.ElementMediator = Montage.create(NJComponent, { } else { + this.application.ninja.documentController.activeDocument.dirtyFlag = true; + NJevent("elementChange", {type : "setMatrix", source: null, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null}); } } -- cgit v1.2.3