sproutcore/sproutcore — pull request #1156 by dcporter (2013-12-31 00:04:14+00:00)
Title: Refactors SC.UndoManager.

Thanks to @nicolasbadia in #1048 for most of this code. We moved SC.UndoManager to the foundation framework, and refactored it, with:

- wildly improved grouping behavior, allowing grouping decisions to be made on the fly rather than requiring full foreknowledge
- a new timestamp property
- long-overdue support for the target/action pattern

That last one is via two new methods: registerUndoAction and registerGroupedUndoAction, which supersede the now-deprecated (but fully supported, for now) registerUndo and registerGroupedUndo. (Oops, I notice that registerGroupedUndo itself was introduced in this pull request too. Short-lived!) You can still bend over backwards with `var that = this` and retaining data in closures if you want, but it's no longer required.

Feeling good about this. Should be fully backwards-compatible, with much better behavior on all fronts. Could someone (@nicolasbadia?) give it a pull and make sure it's solid?

Cheers and happy New Year! :tada: :cocktail: