Toggle undo and redo buttons