- From: Sukolsak Sakshuwong <sukolsak@google.com>
- Date: Fri, 24 Aug 2012 12:45:09 -0700
- To: public-webapps@w3.org
Hi all, According to the UndoManager spec (http://dvcs.w3.org/hg/undomanager/raw-file/tip/undomanager.html#dom-undomanager-undo), we fire an undo event whenever undoManager.undo() is called. However, the spec is kind of ambiguous in regard to multiple DOM transactions. For example, there can be multiple DOM transactions in one entry, which can be achieved by using undoManager.transact(..., true). How should we fire an undo event in this case, and which transaction should we set on the event object? For example, <!DOCTYPE html> <html> <body> <script> var listener = function(event) { console.log("undo event fired"); }; document.addEventListener("undo", listener, false); var transaction = { "execute": function() {}, "undo": function() { console.log("undo"); }, "redo": function() {} }; var undoManager = document.undoManager; undoManager.transact(transaction, false); undoManager.transact(transaction, true); undoManager.undo(); </script> </body> </html> What should be the output from the console in this example? 1. undo undo event fired undo undo event fired or 2. undo undo undo event fired undo event fired or 3. undo undo undo event fired (Which transaction should event.transaction return?) Best regards, Sukolsak Sakshuwong
Received on Friday, 24 August 2012 19:48:40 UTC