diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js index cef0b07dc..dc0a0bcb0 100644 --- a/public/scripts/instruct-mode.js +++ b/public/scripts/instruct-mode.js @@ -629,15 +629,8 @@ jQuery(() => { $('#instruct_enabled').on('change', function () { //color toggle for the main switch - if (power_user.instruct.enabled) { - $('#instruct_enabled').parent().find('i').addClass('toggleEnabled'); - $('#instructSettingsBlock, #InstructSequencesColumn') - .removeClass('disabled'); - } else { - $('#instruct_enabled').parent().find('i').removeClass('toggleEnabled'); - $('#instructSettingsBlock, #InstructSequencesColumn') - .addClass('disabled'); - } + $('#instruct_enabled').parent().find('i').toggleClass('toggleEnabled', !!power_user.instruct.enabled); + $('#instructSettingsBlock, #InstructSequencesColumn').toggleClass('disabled', !power_user.instruct.enabled); if (!power_user.instruct.bind_to_context) { return;