Skip to content

Commit

Permalink
fix folder item overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ploiu committed May 16, 2022
1 parent 28aa0e7 commit 363f961
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/SiteFolderElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ class SiteFolderElement extends HTMLElement {
this.dataset.name;
// we want to show small icons of each site we contain
const folder = this.#shadow.querySelector("div.folder");
let siteCount = 0;
this.#sites.forEach((site) => {
const image = document.createElement("img");
image.src = site.img;
folder.appendChild(image);
if (siteCount < 9) {
const image = document.createElement("img");
image.src = site.img;
folder.appendChild(image);
}
siteCount++;
});
// click handler for showing dialog
this.addEventListener("click", this.openFolder);
Expand Down

0 comments on commit 363f961

Please sign in to comment.