mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 17:02:18 -05:00
Auto-focus on the modal's input field for creation of new entities in editor. Fixes issue #379
This commit is contained in:
parent
74186b7772
commit
947b8766c2
1 changed files with 4 additions and 1 deletions
|
@ -22,7 +22,7 @@ module.exports = class ThangTypeHomeView extends View
|
|||
'change input#search': 'runSearch'
|
||||
'keydown input#search': 'runSearch'
|
||||
'click button.new-model-submit': 'makeNewModel'
|
||||
'submit form': 'makeNewModel'
|
||||
'shown.bs.modal #new-model-modal': 'focusOnName'
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
|
@ -94,3 +94,6 @@ module.exports = class ThangTypeHomeView extends View
|
|||
modal.modal('hide')
|
||||
base = document.location.pathname[1..] + '/'
|
||||
app.router.navigate(base + (model.get('slug') or model.id), {trigger:true})
|
||||
|
||||
focusOnName: ->
|
||||
@$el.find('#name').focus()
|
Loading…
Reference in a new issue