Skip to content

Instantly share code, notes, and snippets.

@danmactough
Created July 31, 2013 14:34
Show Gist options
  • Save danmactough/6122511 to your computer and use it in GitHub Desktop.
Save danmactough/6122511 to your computer and use it in GitHub Desktop.
Easy undo/redo
this.on('change', function () {
changes.push(this.previousAttributes());
});
undo: function () {
undone.push(this.toJSON());
this.set(changes.pop());
};
redo: function () {
this.set(undone.pop());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment