diff --git a/app/views/play/level/playback_view.coffee b/app/views/play/level/playback_view.coffee index 4e54c609b..f9c13a9e3 100644 --- a/app/views/play/level/playback_view.coffee +++ b/app/views/play/level/playback_view.coffee @@ -25,9 +25,7 @@ module.exports = class PlaybackView extends View 'click #debug-toggle': 'onToggleDebug' 'click #grid-toggle': 'onToggleGrid' 'click #edit-wizard-settings': 'onEditWizardSettings' - 'click #music-button': -> - me.set('music', not me.get('music')) - me.save() + 'click #music-button': 'onToggleMusic' 'click #zoom-in-button': -> Backbone.Mediator.publish('camera-zoom-in') unless @disabled 'click #zoom-out-button': -> Backbone.Mediator.publish('camera-zoom-out') unless @disabled 'click #volume-button': 'onToggleVolume' @@ -206,6 +204,12 @@ module.exports = class PlaybackView extends View Backbone.Mediator.publish 'level-set-volume', volume: volumes[newI] $(document.activeElement).blur() + onToggleMusic: (e) -> + e?.preventDefault() + me.set('music', not me.get('music')) + me.save() + $(document.activeElement).blur() + destroy: -> me.off('change:music', @updateMusicButton, @) $(window).off('resize', @onWindowResize)