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
|
// Create a folder listing
|
||||||
const folderListing = document.createElement("div");
|
const folderListing = document.createElement("div");
|
||||||
folderListing.classList.add('folder-list');
|
folderListing.classList.add('folder-list');
|
||||||
folderListing.innerHTML = '<h2>Folders</h2>';
|
if (folders.length > 0) {
|
||||||
|
folderListing.innerHTML = '<h2>Folders</h2>';
|
||||||
|
}
|
||||||
|
|
||||||
// for each folder, add a div to folderListing
|
// for each folder, add a div to folderListing
|
||||||
folders.forEach(folder => {
|
folders.forEach(folder => {
|
||||||
|
|
@ -165,7 +167,9 @@ window.onload = function () {
|
||||||
// then for files
|
// then for files
|
||||||
const fileListing = document.createElement("div");
|
const fileListing = document.createElement("div");
|
||||||
fileListing.classList.add('file-list');
|
fileListing.classList.add('file-list');
|
||||||
fileListing.innerHTML = '<h2>Files</h2>';
|
if (files.length > 0) {
|
||||||
|
fileListing.innerHTML = '<h2>Files</h2>';
|
||||||
|
}
|
||||||
|
|
||||||
// for each file, add a div to fileListing
|
// for each file, add a div to fileListing
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue