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:
parent
161ce2404b
commit
5d1fe2eeaf
6 changed files with 36 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue