smartxml: Don't preprare for undo if it's obvious it will never come
[fnpeditor.git] / src / smartxml / transformations.js
index f0b89f1..5e461ee 100644 (file)
@@ -87,9 +87,9 @@ toret.createGenericTransformation = function(desc, name) {
     };
     _.extend(GenericTransformation.prototype, {
         name: name,
-        run: function() {
+        run: function(options) {
             var changeRoot;
-            if(!desc.undo) {
+            if(!desc.undo && options.beUndoable) {
                 changeRoot = desc.getChangeRoot ? desc.getChangeRoot.call(this) : this.document.root;
                 this.snapshot = changeRoot.clone();
                 this.changeRootPath = changeRoot.getPath();