update
Some checks failed
Deploy Static Site / deploy (push) Failing after 18m22s

This commit is contained in:
2025-05-29 13:53:39 +04:00
parent f3b128ea0f
commit 57f90948aa
3 changed files with 11 additions and 83 deletions

View File

@ -322,15 +322,14 @@ function prepareContent() {
});
}
// const spans = document.querySelectorAll('span');
// if (spans.length) {
// spans.forEach(span => {
// if (span.innerHTML === ' ') {
// span.remove();
// console.log(span.innerHTML);
// }
// });
// }
const spans = document.querySelectorAll('span');
if (spans.length) {
spans.forEach(span => {
if (span.innerHTML === ' ') {
span.remove();
}
});
}
// example exapand
const examplesToggle = document.querySelectorAll(
@ -555,15 +554,6 @@ $(document).ready(function () {
);
}
});
// Дополнительно: обработка void-ссылок
// document.querySelectorAll('a[href^="javascript:"]').forEach((link) => {
// link.addEventListener("click", (e) => {
// e.preventDefault();
// // Можно добавить здесь свою логику обработки клика
// });
// });
//
loadBottomLinks();
hideAllSideUls();
@ -625,67 +615,6 @@ $(document).ready(function () {
prepareContent();
});
} else {
// const _target = evt.target;
// const _targetUl = _target.parentElement.nextElementSibling;
// if (
// _target.nodeName === "SPAN" &&
// _targetUl.nodeName === "UL" &&
// _targetUl.classList.contains("hide-side-menu-item")
// ) {
// _targetUl.querySelectorAll("a")[0].click();
// } else {
// const _ul =
// _target.parentElement.querySelectorAll("a")[0]
// .nextElementSibling;
// if (_ul.nodeName === "UL") {
// _ul.querySelectorAll("a")[0].click();
// }
// }
//is fake
// function isFakeLink(link) {
// if (!link) return false;
// const href = link.getAttribute("href");
// return href === "#" || href === "javascript:void(0);";
// }
// function isRealLink(link) {
// return !!link && !isFakeLink(link);
// }
// function findFirstLinkInElement(element) {
// if (!element) return null;
// return element.querySelector("a");
// }
// function findFirstRealNestedLink(element) {
// if (!element) return null;
// const links = element.querySelectorAll("a");
// for (const link of links) {
// if (isRealLink(link)) return link;
// }
// return null;
// }
// document.addEventListener("click", (evt) => {
// const _target = evt.target;
// if (_target.nodeName !== "SPAN") return;
// const _targetLi = _target.closest("li");
// if (!_targetLi) return;
// const submenu = _targetLi.querySelector("ul");
// const firstLink = findFirstLinkInElement(_targetLi);
// // заглушки
// if (firstLink && isFakeLink(firstLink)) {
// const nestedReal = findFirstRealNestedLink(submenu);
// if (nestedReal) {
// nestedReal.click();
// // в первом фрагменте, после nestedReal.click();
// setTimeout(() => {
// document.dispatchEvent(new Event("subcategory:update"));
// }, 50);
// }
// }
// // Поведение для настоящих ссылок
// else if (firstLink && isRealLink(firstLink)) {
// firstLink.click(); // кликаем по нормальной ссылке
// }
// });
//TEST
//TODO левый ток
function isFakeLink(link) {