From 6ece10e73763187b6d360da63eadc6f7c0d0f256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 20 Dec 2023 11:50:35 +0100 Subject: [PATCH] Fix on a11y carousel play/pause btn --- ts/pages/home.ts | 2 ++ views/pages/home.blade.php | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ts/pages/home.ts b/ts/pages/home.ts index f684535..6603d6a 100644 --- a/ts/pages/home.ts +++ b/ts/pages/home.ts @@ -23,9 +23,11 @@ document.addEventListener("DOMContentLoaded", function () { if (!isRunning) { playPauseBtn.children.item(0)?.classList.remove("d-none"); playPauseBtn.children.item(1)?.classList.add("d-none"); + playPauseBtn.setAttribute('title', String(playPauseBtn.dataset['play'])); } else { playPauseBtn.children.item(0)?.classList.add("d-none"); playPauseBtn.children.item(1)?.classList.remove("d-none"); + playPauseBtn.setAttribute('title', String(playPauseBtn.dataset['stop'])); } }; playPauseBtn.addEventListener("click", () => { diff --git a/views/pages/home.blade.php b/views/pages/home.blade.php index 95a094a..c813da7 100644 --- a/views/pages/home.blade.php +++ b/views/pages/home.blade.php @@ -137,9 +137,11 @@