mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Fixed a bug with old, un-migrated level-set-playing events in button handlers.
This commit is contained in:
parent
a50f6b9224
commit
a0e1806239
2 changed files with 5 additions and 2 deletions
app
|
@ -233,6 +233,7 @@
|
|||
position: relative
|
||||
height: 100%
|
||||
width: 100%
|
||||
z-index: 1
|
||||
|
||||
.bubble
|
||||
position: absolute
|
||||
|
|
|
@ -207,7 +207,8 @@ module.exports = class LevelHUDView extends CocoView
|
|||
if @lastResponses
|
||||
buttons = $('.enter button')
|
||||
for response, i in @lastResponses
|
||||
f = (r) => => setTimeout((-> Backbone.Mediator.publish(r.channel, r.event or {})), 10)
|
||||
channel = response.channel.replace 'level-set-playing', 'level:set-playing' # Easier than migrating all those victory buttons.
|
||||
f = (r) => => setTimeout((-> Backbone.Mediator.publish(channel, r.event or {})), 10)
|
||||
$(buttons[i]).click(f(response))
|
||||
else
|
||||
$('.enter', @bubble).click(-> Backbone.Mediator.publish('script:end-current-script', {}))
|
||||
|
@ -221,7 +222,8 @@ module.exports = class LevelHUDView extends CocoView
|
|||
# If we decide that always having the last one fire is bad, we should make it smarter.
|
||||
return unless @lastResponses?.length
|
||||
r = @lastResponses[@lastResponses.length - 1]
|
||||
_.delay (-> Backbone.Mediator.publish(r.channel, r.event or {})), 10
|
||||
channel = r.channel.replace 'level-set-playing', 'level:set-playing'
|
||||
_.delay (-> Backbone.Mediator.publish(channel, r.event or {})), 10
|
||||
|
||||
onEscapePressed: (e) ->
|
||||
@escapePressed = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue