ArthurClemens/Javascript-Undo-Manager — pull request #1 by ynonp (2012-04-17 14:13:11+00:00)
Title: clear event now calls the callback if stack was not empty

Following the README, writing this:

var onUndoChanged = function(undoManager) {
$('.btnUndo').attr('disabled', !undoManager.hasUndo());
$('.btnRedo').attr('disabled', !undoManager.hasRedo());
};
myUndoManager.setCallback(onUndoChanged)

was not good enough - because after clear event buttons stayed on. In the demo you called updateUI after each action, but since it is called automatically from undo & redo, it seems only fair to have it called automatically from clear as well.