Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tomickigrzegorz committed Jul 15, 2023
1 parent 8e68e52 commit 4476f85
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function showHideLi(e) {

let sumOfAllWidths = 0;
const liElements = document.querySelectorAll(".menu > li:not(.sub-menu)");
let lengthLi = liElements.length;
let widthAllLi = 0;

let arrayLi = [];
Expand All @@ -40,7 +39,7 @@ function showHideLi(e) {

copyLiELementToSubMenu(arrayLi, e.type);

subMenu.classList.add("show-submenu", lengthLi < 8);
subMenu.classList.add("show-submenu", widthMenu - 40 < widthAllLi);

const firstElementFromSubMenu = subMenuContent.firstChild;
const firstELementSubMenu = +firstElementFromSubMenu?.dataset.width;
Expand Down

0 comments on commit 4476f85

Please sign in to comment.