aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-18 18:42:43 -0800
committerAnanya Sen2012-02-18 18:42:43 -0800
commitc2a5918480adae0124e1dc2531c019562f1e3e60 (patch)
tree265faf00991d8737280aa5e5f751d281d1e64cd0 /js
parent2980816130a44cd478b2a9d6606e021efbcebd4a (diff)
downloadninja-c2a5918480adae0124e1dc2531c019562f1e3e60.tar.gz
doc.markEdited() removed from element-mediator, for style changes, as per teams suggestion
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/mediators/element-mediator.js16
-rwxr-xr-xjs/mediators/keyboard-mediator.js3
2 files changed, 2 insertions, 17 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 7dad7aca..6088aeab 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -189,8 +189,6 @@ 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.markEdited();
193
194 return el.elementModel.controller["setShapeProperty"](el, prop, value); 192 return el.elementModel.controller["setShapeProperty"](el, prop, value);
195 } 193 }
196 }, 194 },
@@ -258,8 +256,6 @@ exports.ElementMediator = Montage.create(NJComponent, {
258 256
259 item.elementModel.controller["setAttribute"](item, att, value); 257 item.elementModel.controller["setAttribute"](item, att, value);
260 258
261 this.application.ninja.documentController.activeDocument.markEdited();
262
263 NJevent("attribute" + eventType, {type : "setAttribute", source: source, data: {"els": el, "prop": att, "value": value}, redraw: null}); 259 NJevent("attribute" + eventType, {type : "setAttribute", source: source, data: {"els": el, "prop": att, "value": value}, redraw: null});
264 } 260 }
265 }, 261 },
@@ -332,8 +328,6 @@ exports.ElementMediator = Montage.create(NJComponent, {
332 el.elementModel.controller["setProperty"](el, p, value[i]); 328 el.elementModel.controller["setProperty"](el, p, value[i]);
333 } 329 }
334 330
335 this.application.ninja.documentController.activeDocument.markEdited();
336
337 NJevent("element" + eventType, {type : "setProperty", source: source, data: {"els": els, "prop": p, "value": value}, redraw: null}); 331 NJevent("element" + eventType, {type : "setProperty", source: source, data: {"els": els, "prop": p, "value": value}, redraw: null});
338 } 332 }
339 }, 333 },
@@ -393,8 +387,6 @@ exports.ElementMediator = Montage.create(NJComponent, {
393 el.elementModel.controller["setProperties"](el, props, i); 387 el.elementModel.controller["setProperties"](el, props, i);
394 } 388 }
395 389
396 this.application.ninja.documentController.activeDocument.markEdited();
397
398 NJevent("element" + eventType, {type : "setProperties", source: source, data: {"els": els, "prop": props, "value": props}, redraw: null}); 390 NJevent("element" + eventType, {type : "setProperties", source: source, data: {"els": els, "prop": props, "value": props}, redraw: null});
399 } 391 }
400 }, 392 },
@@ -467,8 +459,6 @@ exports.ElementMediator = Montage.create(NJComponent, {
467 el.elementModel.controller["set3DProperties"](el, props, i, update3DModel); 459 el.elementModel.controller["set3DProperties"](el, props, i, update3DModel);
468 } 460 }
469 461
470 this.application.ninja.documentController.activeDocument.markEdited();
471
472 NJevent("element" + eventType, {type : "set3DProperties", source: source, data: {"els": els, "prop": "matrix", "value": props}, redraw: null}); 462 NJevent("element" + eventType, {type : "set3DProperties", source: source, data: {"els": els, "prop": "matrix", "value": props}, redraw: null});
473 } 463 }
474 }, 464 },
@@ -553,8 +543,6 @@ exports.ElementMediator = Montage.create(NJComponent, {
553 el.elementModel.controller["setColor"](el, value, isFill); 543 el.elementModel.controller["setColor"](el, value, isFill);
554 } 544 }
555 545
556 this.application.ninja.documentController.activeDocument.markEdited();
557
558 NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null}); 546 NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null});
559 } 547 }
560 }, 548 },
@@ -636,8 +624,6 @@ exports.ElementMediator = Montage.create(NJComponent, {
636 el.elementModel.controller["setStroke"](el, value); 624 el.elementModel.controller["setStroke"](el, value);
637 } 625 }
638 626
639 this.application.ninja.documentController.activeDocument.markEdited();
640
641 NJevent("element" + eventType, {type : "setStroke", source: source, data: {"els": els, "prop": "stroke", "value": value}, redraw: null}); 627 NJevent("element" + eventType, {type : "setStroke", source: source, data: {"els": els, "prop": "stroke", "value": value}, redraw: null});
642 } 628 }
643 }, 629 },
@@ -712,8 +698,6 @@ exports.ElementMediator = Montage.create(NJComponent, {
712 } 698 }
713 else 699 else
714 { 700 {
715 this.application.ninja.documentController.activeDocument.markEdited();
716
717 NJevent("elementChange", {type : "setMatrix", source: null, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null}); 701 NJevent("elementChange", {type : "setMatrix", source: null, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null});
718 } 702 }
719 } 703 }
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js
index e348a09b..4011db69 100755
--- a/js/mediators/keyboard-mediator.js
+++ b/js/mediators/keyboard-mediator.js
@@ -85,7 +85,8 @@ exports.KeyboardMediator = Montage.create(Component, {
85 85
86 handleKeydown: { 86 handleKeydown: {
87 value: function(evt) { 87 value: function(evt) {
88 if((document.activeElement.nodeName !== "BODY") && (this.application.ninja.documentController.activeDocument.currentView === "design")) { 88 if((document.activeElement.nodeName !== "BODY") && (!!this.application.ninja.documentController.activeDocument)
89 && (this.application.ninja.documentController.activeDocument.currentView === "design")) {
89 // Don't do anything if an input or other control is focused 90 // Don't do anything if an input or other control is focused
90 return; 91 return;
91 } 92 }