mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Merge pull request #435 from yangshun/editor-modal-input-focus
Auto-focus on the modal's input field for creation of new entities in editor.
This commit is contained in:
commit
5d2c430779
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,7 @@ module.exports = class ThangTypeHomeView extends View
|
|||
'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 +95,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