mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 09:23:41 -04: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'
|
'keydown input#search': 'runSearch'
|
||||||
'click button.new-model-submit': 'makeNewModel'
|
'click button.new-model-submit': 'makeNewModel'
|
||||||
'submit form': 'makeNewModel'
|
'submit form': 'makeNewModel'
|
||||||
|
'shown.bs.modal #new-model-modal': 'focusOnName'
|
||||||
|
|
||||||
getRenderData: ->
|
getRenderData: ->
|
||||||
c = super()
|
c = super()
|
||||||
|
@ -94,3 +95,6 @@ module.exports = class ThangTypeHomeView extends View
|
||||||
modal.modal('hide')
|
modal.modal('hide')
|
||||||
base = document.location.pathname[1..] + '/'
|
base = document.location.pathname[1..] + '/'
|
||||||
app.router.navigate(base + (model.get('slug') or model.id), {trigger:true})
|
app.router.navigate(base + (model.get('slug') or model.id), {trigger:true})
|
||||||
|
|
||||||
|
focusOnName: ->
|
||||||
|
@$el.find('#name').focus()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue