smartxml: signal that operation ended
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 18 Feb 2014 14:24:15 +0000 (15:24 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 23 Apr 2014 11:05:03 +0000 (13:05 +0200)
The following events are considered as operation:
1. running transaction and redoing transaction
2. undoing transaction

src/smartxml/smartxml.js

index dcecc64..c8799f1 100644 (file)
@@ -550,6 +550,7 @@ $.extend(Document.prototype, Backbone.Events, {
 
             this._undoInProgress = false;
             this.redoStack.push(transaction);
 
             this._undoInProgress = false;
             this.redoStack.push(transaction);
+            this.trigger('operationEnd');
         }
     },
     redo: function() {
         }
     },
     redo: function() {
@@ -561,6 +562,8 @@ $.extend(Document.prototype, Backbone.Events, {
             });
             this._transformationLevel--;
             this.undoStack.push(transaction);
             });
             this._transformationLevel--;
             this.undoStack.push(transaction);
+            this.trigger('operationEnd');
+
         }
     },
 
         }
     },
 
@@ -578,6 +581,7 @@ $.extend(Document.prototype, Backbone.Events, {
         }
         if(this._currentTransaction.hasTransformations()) {
             this.undoStack.push(this._currentTransaction);
         }
         if(this._currentTransaction.hasTransformations()) {
             this.undoStack.push(this._currentTransaction);
+            this.trigger('operationEnd');
         }
         this._currentTransaction = null;
     },
         }
         this._currentTransaction = null;
     },