mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-01 15:50:11 -04:00
Fixed cast button click bug.
This commit is contained in:
parent
04abe36837
commit
adaedc240c
1 changed files with 5 additions and 1 deletions
|
@ -11,7 +11,6 @@ module.exports = class CastButtonView extends View
|
|||
'tome:cast-spells': 'onCastSpells'
|
||||
'god:world-load-progress-changed': 'onWorldLoadProgressChanged'
|
||||
'god:new-world-created': 'onNewWorld'
|
||||
'click .cast-button': -> Backbone.Mediator.publish 'tome:manual-cast', {}
|
||||
'click .cast-options a': 'onCastOptionsClick'
|
||||
|
||||
constructor: (options) ->
|
||||
|
@ -31,6 +30,7 @@ module.exports = class CastButtonView extends View
|
|||
@castButton = $('.cast-button', @$el)
|
||||
@castButtonGroup = $('.cast-button-group', @$el)
|
||||
@castOptions = $('.autocast-delays', @$el)
|
||||
@castButton.on 'click', @onCastButtonClick
|
||||
# TODO: use a User setting instead of localStorage
|
||||
delay = localStorage.getItem 'autocastDelay'
|
||||
delay ?= 5000
|
||||
|
@ -39,6 +39,9 @@ module.exports = class CastButtonView extends View
|
|||
attachTo: (spellView) ->
|
||||
@$el.detach().prependTo(spellView.toolbarView.$el).show()
|
||||
|
||||
onCastButtonClick: (e) ->
|
||||
Backbone.Mediator.publish 'tome:manual-cast', {}
|
||||
|
||||
onCastOptionsClick: (e) ->
|
||||
Backbone.Mediator.publish 'focus-editor'
|
||||
@castButtonGroup.removeClass 'open'
|
||||
|
@ -85,3 +88,4 @@ module.exports = class CastButtonView extends View
|
|||
|
||||
destroy: ->
|
||||
super()
|
||||
@castButton.off 'click', @onCastButtonClick
|
||||
|
|
Loading…
Add table
Reference in a new issue