mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-18 05:25:04 +00:00
20 lines
711 B
JavaScript
20 lines
711 B
JavaScript
function removeElements() {
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
document.querySelectorAll('.navbar-item').forEach((element) => {
|
|
const dropdownItems = element.querySelectorAll('.dropdown-item');
|
|
const items = Array.from(dropdownItems).filter((item) => !item.querySelector('hr.dropdown-divider'));
|
|
|
|
if (items.length == 0) {
|
|
if (
|
|
element.previousElementSibling &&
|
|
element.previousElementSibling.classList.contains('navbar-item') &&
|
|
element.previousElementSibling.classList.contains('nav-item-separator')
|
|
) {
|
|
element.previousElementSibling.remove();
|
|
}
|
|
element.remove();
|
|
}
|
|
});
|
|
});
|
|
}
|