diff options
author | Erik Michelson | 2020-01-08 18:37:11 +0100 |
---|---|---|
committer | Erik Michelson | 2020-01-08 18:37:11 +0100 |
commit | c9abe4276f1575ee3e0fff7de3f4e07c1ca53a05 (patch) | |
tree | 23f50674337c55ab27a6bc81b161476931076cd3 | |
parent | 472ae01546ac041657429fb8590c32b1794aff1c (diff) |
Fix #249 - Focus user field after opening login modal
Signed-off-by: Erik Michelson <erik@liltv.de>
-rw-r--r-- | public/js/cover.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/public/js/cover.js b/public/js/cover.js index 94748cdc..39f748e9 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -428,3 +428,17 @@ $('.ui-use-tags').on('change', function () { $('.search').keyup(() => { 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() + } +}) |