fix(a11y): disableImages not working when layoutBackgroundBlur is false

This commit is contained in:
ZhenShuo Leo committed 2025-08-05 18:23:16 +08:00
1 parent 10ffbca4c0
commit ade00547b3
4 files changed
+20 -29

No files matched your search

+4 -8
View File
@@ -16,14 +16,10 @@ window.A11yPanel = (() => {
disableImages: {
default: false,
apply: (enabled) => {
document.querySelectorAll("script[data-target-id]").forEach((script) => {
const image = document.getElementById(script.getAttribute("data-image-id"));
const imageUrl = script.getAttribute("data-image-url");
if (image) {
image.style.display = enabled ? "none" : "";
if (!enabled && imageUrl && !image.src) image.src = imageUrl;
}
});
const image = document.getElementById("background-image");
if (image) {
image.style.display = enabled ? "none" : "";
}
},
},