only show headers if section would be populated
This commit is contained in:
parent
1e998e5d20
commit
f322c1cf08
1 changed files with 6 additions and 2 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue