Add Done button hotkey

This commit is contained in:
Nick Winter 2016-07-22 17:59:32 -07:00
parent 12f46a6f31
commit ea61499a10

View file

@ -131,7 +131,10 @@ module.exports = class SpellView extends CocoView
name: 'run-code-real-time'
bindKey: {win: 'Ctrl-Shift-Enter', mac: 'Command-Shift-Enter|Ctrl-Shift-Enter'}
exec: =>
if @options.level.get('replayable') and (timeUntilResubmit = @session.timeUntilResubmit()) > 0
doneButton = @$('.done-button:visible')
if doneButton.length
doneButton.trigger 'click'
else if @options.level.get('replayable') and (timeUntilResubmit = @session.timeUntilResubmit()) > 0
Backbone.Mediator.publish 'tome:manual-cast-denied', timeUntilResubmit: timeUntilResubmit
else
Backbone.Mediator.publish 'tome:manual-cast', {realTime: true}