only show headers if section would be populated

This commit is contained in:
John Hess 2024-06-12 21:05:23 -05:00
parent 1e998e5d20
commit f322c1cf08

View file

@ -145,7 +145,9 @@ window.onload = function () {
// Create a folder listing
const folderListing = document.createElement("div");
folderListing.classList.add('folder-list');
if (folders.length > 0) {
folderListing.innerHTML = '<h2>Folders</h2>';
}
// for each folder, add a div to folderListing
folders.forEach(folder => {
@ -165,7 +167,9 @@ window.onload = function () {
// then for files
const fileListing = document.createElement("div");
fileListing.classList.add('file-list');
if (files.length > 0) {
fileListing.innerHTML = '<h2>Files</h2>';
}
// for each file, add a div to fileListing
files.forEach(file => {