fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
smartxml: testing three available levels of transformation undo-awareness
[fnpeditor.git]
/
src
/
smartxml
/
transformations.js
diff --git
a/src/smartxml/transformations.js
b/src/smartxml/transformations.js
index
5e461ee
..
9aea150
100644
(file)
--- a/
src/smartxml/transformations.js
+++ b/
src/smartxml/transformations.js
@@
-95,13
+95,14
@@
toret.createGenericTransformation = function(desc, name) {
this.changeRootPath = changeRoot.getPath();
}
//var toret = desc.impl.call(this.context, this.args); // a argumenty do metody?
this.changeRootPath = changeRoot.getPath();
}
//var toret = desc.impl.call(this.context, this.args); // a argumenty do metody?
- var toret = desc.impl.apply(this.context, this.args);
+ var argsToPass = desc.undo ? [this].concat(this.args) : this.args;
+ var toret = desc.impl.apply(this.context, argsToPass);
this.hasRun = true;
return toret;
},
undo: function() {
if(desc.undo) {
this.hasRun = true;
return toret;
},
undo: function() {
if(desc.undo) {
- desc.undo.call(this.context);
+ desc.undo.call(this.context
, this
);
} else {
this.document.getNodeByPath(this.changeRootPath).replaceWith(this.snapshot);
}
} else {
this.document.getNodeByPath(this.changeRootPath).replaceWith(this.snapshot);
}