[whatwg] Fixing undo on the Web - UndoManager and Transaction

On Wed, Sep 21, 2011 at 12:58 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> So apply, unapply, and reapply are callback functions supplied by authors
> and called by UAs.
> e.g.
> myUndoScope.undoManager.transact({
> ? apply: function() {alert('done');},
> ? unapply: function() {alert('undone');},
> ? reapply: function() {alert('redone');}
> })
>
> the above code inserts a new transaction which pops up alert('done'), and
> then alert('undo') and alert('redone') when the transaction is undone or
> redone. ?But undo/redo of a transaction is done through undoManager.undo,
> undoManager.redo, or execCommand so authors don't ever call unapply or
> reapply functions directly in those normal use cases.

Oh, I see.  Okay, then, having a boolean argument isn't such a big
problem.  "return true" and "return false" aren't as bad, because you
only have to deal with one at a time.

Received on Wednesday, 21 September 2011 13:41:34 UTC