mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Restarting level now doesn't clear anything except code unless you hold down shift.
This commit is contained in:
parent
6755c90f02
commit
f310719cee
3 changed files with 9 additions and 3 deletions
app
|
@ -35,7 +35,7 @@ module.exports =
|
|||
|
||||
'tome:toggle-spell-list': c.object {title: 'Toggle Spell List', description: 'Published when you toggle the dropdown for a thang\'s spells'}
|
||||
|
||||
'tome:reload-code': c.object {title: 'Reload Code', description: 'Published when you reset a spell to its original source', required: ['spell']},
|
||||
'tome:reload-code': c.object {title: 'Reload Code', description: 'Published when you reset a spell to its original source', required: []},
|
||||
spell: {type: 'object'}
|
||||
|
||||
'tome:palette-cleared': c.object {title: 'Palette Cleared', description: 'Published when the spell palette is about to be cleared and recreated.'},
|
||||
|
|
|
@ -6,4 +6,10 @@ module.exports = class ReloadLevelModal extends ModalView
|
|||
template: template
|
||||
|
||||
events:
|
||||
'click #restart-level-confirm-button': -> Backbone.Mediator.publish 'level:restart', {}
|
||||
'click #restart-level-confirm-button': 'onClickRestart'
|
||||
|
||||
onClickRestart: (e) ->
|
||||
if key.shift
|
||||
Backbone.Mediator.publish 'level:restart', {}
|
||||
else
|
||||
Backbone.Mediator.publish 'tome:reload-code', {}
|
||||
|
|
|
@ -394,7 +394,7 @@ module.exports = class SpellView extends CocoView
|
|||
@focus() if cast
|
||||
|
||||
onCodeReload: (e) ->
|
||||
return unless e.spell is @spell
|
||||
return unless e.spell is @spell or not e.spell
|
||||
@reloadCode true
|
||||
@ace.clearSelection()
|
||||
_.delay (=> @ace?.clearSelection()), 500 # Make double sure this gets done (saw some timing issues?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue