fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
undo wip: fixes + smoke test
[fnpeditor.git]
/
src
/
smartxml
/
smartxml.js
diff --git
a/src/smartxml/smartxml.js
b/src/smartxml/smartxml.js
index
47c527f
..
d722c20
100644
(file)
--- a/
src/smartxml/smartxml.js
+++ b/
src/smartxml/smartxml.js
@@
-431,7
+431,7
@@
$.extend(Document.prototype, Backbone.Events, {
if(transformation) {
this._transformationLevel++;
toret = transformation.run();
if(transformation) {
this._transformationLevel++;
toret = transformation.run();
- if(this._transformationLevel === 1) {
+ if(this._transformationLevel === 1
&& !this._undoInProgress
) {
this.undoStack.push(transformation);
}
this._transformationLevel--;
this.undoStack.push(transformation);
}
this._transformationLevel--;
@@
-445,14
+445,18
@@
$.extend(Document.prototype, Backbone.Events, {
undo: function() {
var transformation = this.undoStack.pop();
if(transformation) {
undo: function() {
var transformation = this.undoStack.pop();
if(transformation) {
+ this._undoInProgress = true;
transformation.undo();
transformation.undo();
+ this._undoInProgress = false;
this.redoStack.push(transformation);
}
},
redo: function() {
var transformation = this.redoStack.pop();
if(transformation) {
this.redoStack.push(transformation);
}
},
redo: function() {
var transformation = this.redoStack.pop();
if(transformation) {
+ this._transformationLevel++;
transformation.run();
transformation.run();
+ this._transformationLevel--;
this.undoStack.push(transformation);
}
},
this.undoStack.push(transformation);
}
},