From c2a5918480adae0124e1dc2531c019562f1e3e60 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Sat, 18 Feb 2012 18:42:43 -0800 Subject: doc.markEdited() removed from element-mediator, for style changes, as per teams suggestion Signed-off-by: Ananya Sen --- js/mediators/element-mediator.js | 16 ---------------- js/mediators/keyboard-mediator.js | 3 ++- 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, { NJUtils.makeElementModel(el, "Canvas", "block", true); } - this.application.ninja.documentController.activeDocument.markEdited(); - return el.elementModel.controller["setShapeProperty"](el, prop, value); } }, @@ -258,8 +256,6 @@ exports.ElementMediator = Montage.create(NJComponent, { item.elementModel.controller["setAttribute"](item, att, value); - this.application.ninja.documentController.activeDocument.markEdited(); - NJevent("attribute" + eventType, {type : "setAttribute", source: source, data: {"els": el, "prop": att, "value": value}, redraw: null}); } }, @@ -332,8 +328,6 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["setProperty"](el, p, value[i]); } - this.application.ninja.documentController.activeDocument.markEdited(); - NJevent("element" + eventType, {type : "setProperty", source: source, data: {"els": els, "prop": p, "value": value}, redraw: null}); } }, @@ -393,8 +387,6 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["setProperties"](el, props, i); } - this.application.ninja.documentController.activeDocument.markEdited(); - NJevent("element" + eventType, {type : "setProperties", source: source, data: {"els": els, "prop": props, "value": props}, redraw: null}); } }, @@ -467,8 +459,6 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["set3DProperties"](el, props, i, update3DModel); } - this.application.ninja.documentController.activeDocument.markEdited(); - NJevent("element" + eventType, {type : "set3DProperties", source: source, data: {"els": els, "prop": "matrix", "value": props}, redraw: null}); } }, @@ -553,8 +543,6 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["setColor"](el, value, isFill); } - this.application.ninja.documentController.activeDocument.markEdited(); - NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null}); } }, @@ -636,8 +624,6 @@ exports.ElementMediator = Montage.create(NJComponent, { el.elementModel.controller["setStroke"](el, value); } - this.application.ninja.documentController.activeDocument.markEdited(); - NJevent("element" + eventType, {type : "setStroke", source: source, data: {"els": els, "prop": "stroke", "value": value}, redraw: null}); } }, @@ -712,8 +698,6 @@ exports.ElementMediator = Montage.create(NJComponent, { } else { - this.application.ninja.documentController.activeDocument.markEdited(); - NJevent("elementChange", {type : "setMatrix", source: null, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null}); } } 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, { handleKeydown: { value: function(evt) { - if((document.activeElement.nodeName !== "BODY") && (this.application.ninja.documentController.activeDocument.currentView === "design")) { + if((document.activeElement.nodeName !== "BODY") && (!!this.application.ninja.documentController.activeDocument) + && (this.application.ninja.documentController.activeDocument.currentView === "design")) { // Don't do anything if an input or other control is focused return; } -- cgit v1.2.3