update
All checks were successful
Deploy Static Site / deploy (push) Successful in 13m32s

This commit is contained in:
2025-05-29 11:02:01 +04:00
parent 9bd0dbc92f
commit f3b128ea0f

View File

@ -327,18 +327,7 @@ function prepareContent() {
spans.forEach(span => {
if (span.innerHTML === ' ') {
span.remove();
console.log(span.innerHTML);
}
});
}
const p = document.querySelectorAll('p');
if (p) {
p.forEach(p => {
if (p.innerHTML === '') {
p.remove();
console.log(p.innerHTML);
}
}
});
}
@ -565,15 +554,6 @@ $(document).ready(function () {
);
}
});
// Дополнительно: обработка void-ссылок
// document.querySelectorAll('a[href^="javascript:"]').forEach((link) => {
// link.addEventListener("click", (e) => {
// e.preventDefault();
// // Можно добавить здесь свою логику обработки клика
// });
// });
//
loadBottomLinks();
hideAllSideUls();
@ -635,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) {