From 372d5f8f9e9b4c4f4f9de8360abe9966e45a82ad Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 9 Mar 2019 19:14:44 +0100 Subject: [PATCH] Improved a11y of upload buttons See #2713 --- wcfsetup/install/files/js/WCF.js | 4 ++++ wcfsetup/install/files/js/WoltLabSuite/Core/Upload.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 71adbda74a..ee3d413abd 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -5944,10 +5944,14 @@ if (COMPILER_TARGET_DEFAULT) { this._fileUpload = $(''); this._fileUpload.change($.proxy(this._upload, this)); var $button = $('

' + WCF.Language.get('wcf.global.button.upload') + '

'); + elAttr($button[0], 'role', 'button'); + elAttr($button[0], 'tabindex', '0'); $button.prepend(this._fileUpload); } else { var $button = $('

' + WCF.Language.get('wcf.global.button.upload') + '

'); + elAttr($button[0], 'role', 'button'); + elAttr($button[0], 'tabindex', '0'); $button.click($.proxy(this._showOverlay, this)); } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Upload.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Upload.js index e9cf97a402..bba83d7276 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Upload.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Upload.js @@ -92,6 +92,8 @@ define(['AjaxRequest', 'Core', 'Dom/ChangeListener', 'Language', 'Dom/Util', 'Do this._button = elCreate('p'); this._button.className = 'button uploadButton'; + elAttr(this._button, 'role', 'button'); + elAttr(this._button, 'tabindex', '0'); var span = elCreate('span'); span.textContent = Language.get('wcf.global.button.upload'); -- 2.20.1