דילוג לתוכן
- בחירת תוצאות נבחרות בעמוד מלא חדש.
- פותח בחלון חדש.
(function () {
const SELECTOR = "button-expand-panel-element";
function applyStyles(host) {
const shadowRoot = host.shadowRoot;
if (!shadowRoot) return false;
const button = shadowRoot.querySelector("button");
const border = shadowRoot.querySelector("svg.tr-border-svg");
const icon = shadowRoot.querySelector("svg.tr-icon");
if (!button || !border || !icon) {
return false;
}
// מיקום וגודל הכפתור
button.style.setProperty("bottom", "46px", "important");
button.style.setProperty("right", "18px", "important");
button.style.setProperty("width", "46px", "important");
button.style.setProperty("height", "46px", "important");
// גודל המסגרת
border.style.setProperty("width", "39px", "important");
border.style.setProperty("height", "50px", "important");
// גודל האייקון
icon.style.setProperty("height", "24px", "important");
return true;
}
function watchHost(host) {
if (!host || host.dataset.accessibilityStyled === "true") {
return;
}
host.dataset.accessibilityStyled = "true";
// ניסיון ראשוני
applyStyles(host);
if (!host.shadowRoot) return;
// אם אפליקציית הנגישות מרנדרת מחדש את הכפתור
// הקוד יחיל שוב את העיצוב
const observer = new MutationObserver(() => {
applyStyles(host);
});
observer.observe(host.shadowRoot, {
childList: true,
subtree: true,
attributes: true
});
}
function findButtons(root = document) {
root.querySelectorAll(SELECTOR).forEach(watchHost);
}
function init() {
// כפתור שכבר קיים בעמוד
findButtons();
// מעקב אחר כפתור שנוסף לאחר טעינת האתר
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
mutation.addedNodes.forEach((node) => {
if (!(node instanceof Element)) return;
if (node.matches(SELECTOR)) {
watchHost(node);
}
findButtons(node);
});
});
});
observer.observe(document.documentElement, {
childList: true,
subtree: true
});
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
})();