Merge pull request #250 from ErikMichelson/fix/signin-focus

Fix #249 - Focus user field after opening login modal
This commit is contained in:
Sheogorath 2020-01-20 18:55:33 +01:00 committed by GitHub
commit 5a8621bdee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -428,3 +428,17 @@ $('.ui-use-tags').on('change', function () {
$('.search').keyup(() => { $('.search').keyup(() => {
checkHistoryList() checkHistoryList()
}) })
// focus user field after opening login modal
$('.signin-modal').on('shown.bs.modal', function () {
let fieldLDAP = $('input[name=username]')
let fieldEmail = $('input[name=email]')
let fieldOpenID = $('input[name=openid_identifier]')
if (fieldLDAP.length === 1) {
fieldLDAP.focus()
} else if (fieldEmail.length === 1) {
fieldEmail.focus()
} else if (fieldOpenID.length === 1) {
fieldOpenID.focus()
}
})