diff options
| author | lonkaars <loek@pipeframe.xyz> | 2023-10-08 09:24:56 +0200 |
|---|---|---|
| committer | lonkaars <loek@pipeframe.xyz> | 2023-10-08 09:24:56 +0200 |
| commit | 42741c43857dc3b32f66d9f9b60e259a4780d8b4 (patch) | |
| tree | bb00ccd03c0022f22788791b8448bd7893acdf69 /anki-card-template/card.js | |
| parent | 69cf8d2114219dccaf80a4e951857505407eb4d4 (diff) | |
fix "noaudio" detection on mobile and add tap-highlight to play button on mobile3.5.2
Diffstat (limited to 'anki-card-template/card.js')
| -rw-r--r-- | anki-card-template/card.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/anki-card-template/card.js b/anki-card-template/card.js index 193e7fe..a98e2fe 100644 --- a/anki-card-template/card.js +++ b/anki-card-template/card.js @@ -419,14 +419,17 @@ function run() { document.getElementById("sentence-translation").classList.add("visible"); } - // replace ugly anki play icon with material design icon - for (var el of document.querySelectorAll("#audio .replay-button")) { - el.innerHTML = document.getElementById("play-icon").outerHTML; - el.children[0].classList.remove("display-none"); - } var audio = document.getElementById("audio"); - if (audio.innerText.trim() == "noaudio") audio.classList.add("display-none"); + if (audio != null && audio.innerHTML == "noaudio") { + audio.classList.add("display-none"); + } else { + // replace ugly anki play icon with material design icon + for (var el of document.querySelectorAll("#audio .replay-button")) { + el.innerHTML = document.getElementById("play-icon").outerHTML; + el.children[0].classList.remove("display-none"); + } + } layout(); } |