From 21b3b3c9d13c54397ef822fd6f48d50e51bba29a Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Wed, 8 Aug 2018 14:57:45 -0400 Subject: [PATCH] Disable undo/redo buttons appropriately --- index.html | 1 - src/app.coffee | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index fbbb990..d0f1cf7 100644 --- a/index.html +++ b/index.html @@ -109,7 +109,6 @@

Interactive Fretboard

Tablature Editor

- diff --git a/src/app.coffee b/src/app.coffee index c198e5a..e39d1d4 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -113,6 +113,12 @@ redo_button.addEventListener "click", -> tablature_editor.editor.redo() return +tablature_editor.editor.on "input", -> + undo_manager = tablature_editor.editor.session.getUndoManager() + undo_button.disabled = not undo_manager.hasUndo() + redo_button.disabled = not undo_manager.hasRedo() + + do update_multi_row_selection_mode = -> tablature_editor.multi_row_selection_mode = multi_row_selection_mode_input.checked return