LIT-EIA / adapt-esdc-accessibilityfixes

Extension to load and run a .js file when a course loads
GNU General Public License v3.0
5 stars 2 forks source link

Component - Narrative (and maybe others) Aria-label not converted to Alt #149

Closed graphicidentity closed 2 years ago

graphicidentity commented 2 years ago

In some Adapt component the Aria label text is not converted to alt text. For example, the image in the narrative component still uses Aria.

falcochip commented 2 years ago

altered altFixes() to apply aria-label to img alt in narrative components

// check if img is in narrative component if ($(this).parents('.narrative-component').length == 1) { var widget = $(this).closest('.narrative-widget'); var imgIndex = $(this).parents('.narrative-slider-graphic').attr('data-index'); var altText = widget.find('div.narrative-content-item[data-index="' + imgIndex + '"]>div.aria-label').attr('aria-label'); $(this).attr('alt', altText) }