1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add aria-labels for accessibility

This commit is contained in:
Dmitry Lyzo 2022-01-18 14:52:53 +03:00
parent 161ce2404b
commit 5d1fe2eeaf
6 changed files with 36 additions and 11 deletions

View file

@ -262,6 +262,17 @@
/* eslint-enable indent */
/**
* Sets title and ARIA-label of element.
* @param {HTMLElement} elem - Element to set the title and ARIA-label.
* @param {string} title - Title.
* @param {string?} [ariaLabel] - ARIA-label.
*/
export function setElementTitle(elem, title, ariaLabel) {
elem.setAttribute('title', title);
elem.setAttribute('aria-label', ariaLabel);
}
export default {
parentWithAttribute: parentWithAttribute,
parentWithClass: parentWithClass,
@ -270,6 +281,7 @@ export default {
removeEventListener: removeEventListener,
getWindowSize: getWindowSize,
getScreenWidth: getScreenWidth,
setElementTitle,
whichTransitionEvent: whichTransitionEvent,
whichAnimationEvent: whichAnimationEvent,
whichAnimationCancelEvent: whichAnimationCancelEvent