aboutsummaryrefslogtreecommitdiff
path: root/js/mediators/element-mediator.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/mediators/element-mediator.js')
-rwxr-xr-xjs/mediators/element-mediator.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 09f2aeed..b0efc02b 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -84,6 +84,23 @@ exports.ElementMediator = Montage.create(Component, {
84 } 84 }
85 }, 85 },
86 86
87 replaceElement: {
88 value: function(newChild, oldChild, notify) {
89
90 this.application.ninja.currentDocument.documentRoot.replaceChild(newChild, oldChild);
91
92 var undoLabel = "replace element";
93
94 document.application.undoManager.add(undoLabel, this.replaceElement, this, oldChild, newChild);
95
96 this.application.ninja.documentController.activeDocument.needsSave = true;
97
98 if(notify || notify === undefined) {
99 NJevent("elementReplaced", {type : "replaceElement", data: {"newChild": newChild, "oldChild": oldChild}});
100 }
101 }
102 },
103
87 getProperty: { 104 getProperty: {
88 value: function(el, prop, valueMutator) { 105 value: function(el, prop, valueMutator) {
89 if(!el.elementModel) { 106 if(!el.elementModel) {