From b9c67a036b6374c02dbcf674f2377efb88e07658 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 18 Apr 2016 10:43:09 +0200 Subject: [PATCH] Re-Added autofocus support for dialogs --- com.woltlab.wcf/templates/pageHeaderUser.tpl | 2 +- wcfsetup/install/files/js/WoltLab/WCF/Ui/Dialog.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/com.woltlab.wcf/templates/pageHeaderUser.tpl b/com.woltlab.wcf/templates/pageHeaderUser.tpl index 4ed650ff1b..612a6900a2 100644 --- a/com.woltlab.wcf/templates/pageHeaderUser.tpl +++ b/com.woltlab.wcf/templates/pageHeaderUser.tpl @@ -140,7 +140,7 @@
- +
diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Dialog.js b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Dialog.js index 4ae4a9e6d3..00adba2796 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Dialog.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Dialog.js @@ -389,6 +389,12 @@ define( this.rebuild(id); + // set focus on first applicable element + var focusElement = elBySel('.jsDialogAutoFocus', data.dialog); + if (focusElement !== null && focusElement.offsetParent !== null) { + focusElement.focus(); + } + if (typeof data.onShow === 'function') { data.onShow(id); } -- 2.20.1