fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wip: blocking nested transformations from being pushed on undo stack
[fnpeditor.git]
/
src
/
smartxml
/
smartxml.js
diff --git
a/src/smartxml/smartxml.js
b/src/smartxml/smartxml.js
index
fc9715b
..
aa9a7c5
100644
(file)
--- a/
src/smartxml/smartxml.js
+++ b/
src/smartxml/smartxml.js
@@
-565,6
+565,7
@@
var Document = function(xml) {
this.loadXML(xml);
this.undoStack = [];
this.redoStack = [];
this.loadXML(xml);
this.undoStack = [];
this.redoStack = [];
+ this._transformationLevel = 0;
};
$.extend(Document.prototype, Backbone.Events, {
};
$.extend(Document.prototype, Backbone.Events, {
@@
-752,8
+753,12
@@
$.extend(Document.prototype, Backbone.Events, {
}
}
if(transformation) {
}
}
if(transformation) {
+ this._transformationLevel++;
toret = transformation.run();
toret = transformation.run();
- this.undoStack.push(transformation);
+ if(this._transformationLevel === 1) {
+ this.undoStack.push(transformation);
+ }
+ this._transformationLevel--;
console.log('clearing redo stack');
this.redoStack = [];
return toret;
console.log('clearing redo stack');
this.redoStack = [];
return toret;