Accessibility: correction after return of HAN - #1785 + #1853

This commit is contained in:
Laurent GAY
2025-10-07 15:45:52 +02:00
parent 7219e25360
commit c2dff26afa
2 changed files with 19 additions and 0 deletions

View File

@@ -15,3 +15,9 @@ export function escapeHtml(html: string) {
return escapedContent;
}
export function getElementByXPath(path: string) {
return new XPathEvaluator()
.createExpression(path)
.evaluate(document, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue;
}

View File

@@ -14,6 +14,19 @@
import { useI18n } from "vue-i18n";
import EventsAgenda from "@/components/FullCalendar/EventsAgenda.vue";
import EventsCalendar from "@/components/FullCalendar/EventsCalendar.vue";
import { onMounted } from "vue";
import { getElementByXPath } from "@/utils/html";
onMounted(() => {
const icon_left = getElementByXPath(
"//span[contains(@class,'fc-icon-chevron-left')]"
);
icon_left.setAttribute("aria-label", t("Previous"));
const icon_right = getElementByXPath(
"//span[contains(@class,'fc-icon-chevron-right')]"
);
icon_right.setAttribute("aria-label", t("Next"));
});
const { t } = useI18n({ useScope: "global" });