summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheogorath2020-01-20 18:55:33 +0100
committerGitHub2020-01-20 18:55:33 +0100
commit5a8621bdeed7e5804b9a82408fc178b91f473e9c (patch)
tree54e00c94971c838a835e3863e7d53bef230947d2
parentbebbf7721793d592e02ae6b76bdaf993379badef (diff)
parentc9abe4276f1575ee3e0fff7de3f4e07c1ca53a05 (diff)
Merge pull request #250 from ErikMichelson/fix/signin-focus
Fix #249 - Focus user field after opening login modal
-rw-r--r--public/js/cover.js14
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()
+ }
+})