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

This commit is contained in:
ZhenShuo Leo
2025-08-05 16:39:50 +08:00
parent 10ffbca4c0
commit ade00547b3
4 changed files with 20 additions and 29 deletions
+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" : "";
}
},
},