mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2024-12-21 19:08:24 +01:00
fix tool removal in navbar
This commit is contained in:
parent
0cc12f4456
commit
6adeecac9c
@ -60,23 +60,22 @@ function handleDropdownItemClick(event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
document.querySelectorAll(".nav-item.dropdown").forEach((element) => {
|
|
||||||
const dropdownMenu = element.querySelector(".dropdown-menu");
|
document.querySelectorAll(".col-lg-2.col-sm-6").forEach((element) => {
|
||||||
if (
|
const dropdownItems = element.querySelectorAll(".dropdown-item");
|
||||||
dropdownMenu.id !== "favoritesDropdown" &&
|
const items = Array.from(dropdownItems).filter(item => !item.querySelector("hr.dropdown-divider"));
|
||||||
dropdownMenu.children.length <= 2 &&
|
|
||||||
dropdownMenu.querySelectorAll("hr.dropdown-divider").length === dropdownMenu.children.length
|
if (items.length <= 2) {
|
||||||
) {
|
if (
|
||||||
if (
|
element.previousElementSibling &&
|
||||||
element.previousElementSibling &&
|
element.previousElementSibling.classList.contains("col-lg-2") &&
|
||||||
element.previousElementSibling.classList.contains("nav-item") &&
|
element.previousElementSibling.classList.contains("nav-item-separator")
|
||||||
element.previousElementSibling.classList.contains("nav-item-separator")
|
) {
|
||||||
) {
|
element.previousElementSibling.remove();
|
||||||
element.previousElementSibling.remove();
|
}
|
||||||
}
|
element.remove();
|
||||||
element.remove();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//Sort languages by alphabet
|
//Sort languages by alphabet
|
||||||
const list = Array.from(document.querySelector('.dropdown-menu[aria-labelledby="languageDropdown"]').children).filter(
|
const list = Array.from(document.querySelector('.dropdown-menu[aria-labelledby="languageDropdown"]').children).filter(
|
||||||
|
Loading…
Reference in New Issue
Block a user