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
|
position: relative
|
||||||
height: 100%
|
height: 100%
|
||||||
width: 100%
|
width: 100%
|
||||||
|
z-index: 1
|
||||||
|
|
||||||
.bubble
|
.bubble
|
||||||
position: absolute
|
position: absolute
|
||||||
|
|
|
@ -207,7 +207,8 @@ module.exports = class LevelHUDView extends CocoView
|
||||||
if @lastResponses
|
if @lastResponses
|
||||||
buttons = $('.enter button')
|
buttons = $('.enter button')
|
||||||
for response, i in @lastResponses
|
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))
|
$(buttons[i]).click(f(response))
|
||||||
else
|
else
|
||||||
$('.enter', @bubble).click(-> Backbone.Mediator.publish('script:end-current-script', {}))
|
$('.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.
|
# If we decide that always having the last one fire is bad, we should make it smarter.
|
||||||
return unless @lastResponses?.length
|
return unless @lastResponses?.length
|
||||||
r = @lastResponses[@lastResponses.length - 1]
|
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) ->
|
onEscapePressed: (e) ->
|
||||||
@escapePressed = true
|
@escapePressed = true
|
||||||
|
|
Reference in a new issue