mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
Blur the music button after click so that subsequent space and enter keydown events do not trigger it. Fixes issue #306.
This commit is contained in:
parent
bb76fb241c
commit
b48a9fabc6
1 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue