X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/90a4709555ba28d2175c7a359d538e7775f9bf64..7a4bca3706dc42043a773ece492592f6950814fa:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 47c527f..d722c20 100644 --- 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(this._transformationLevel === 1) { + if(this._transformationLevel === 1 && !this._undoInProgress) { this.undoStack.push(transformation); } this._transformationLevel--; @@ -445,14 +445,18 @@ $.extend(Document.prototype, Backbone.Events, { undo: function() { var transformation = this.undoStack.pop(); if(transformation) { + this._undoInProgress = true; transformation.undo(); + this._undoInProgress = false; this.redoStack.push(transformation); } }, redo: function() { var transformation = this.redoStack.pop(); if(transformation) { + this._transformationLevel++; transformation.run(); + this._transformationLevel--; this.undoStack.push(transformation); } },