- _.keys(this.args).forEach(function(key) {
- if(transformation.args[key].nodeType) { //@@ change to instanceof check, fix circular dependency
- var value = transformation.args[key],
- path = value.getPath();
- Object.defineProperty(transformation.args, key, {
- get: function() {
- if(transformation.hasRun) {
- //console.log('returning via path');
- return transformation.document.getNodeByPath(path);
- } else {
- //console.log('returning original arg');
- return value;
-
+ // _.keys(this.args).forEach(function(key) {
+ // if(transformation.args[key].nodeType) { //@@ change to instanceof check, fix circular dependency
+ // var value = transformation.args[key],
+ // path = value.getPath();
+ // Object.defineProperty(transformation.args, key, {
+ // get: function() {
+ // if(transformation.hasRun) {
+ // //console.log('returning via path');
+ // return transformation.document.getNodeByPath(path);
+ // } else {
+ // //console.log('returning original arg');
+ // return value;
+
+ // }
+ // }
+ // });
+ // }
+ // });
+
+ // potem spr na dotychczasowych undo/redo tests;
+
+
+ this.args.forEach(function(arg, idx, args) {
+ var path;
+ if(arg) {
+ if(arg.nodeType) { // ~
+ path = arg.getPath();
+ Object.defineProperty(args, idx, {
+ get: function() {
+ if(transformation.hasRun && path) {
+ return transformation.document.getNodeByPath(path);
+ } else {
+ return arg;
+ }