Fixed Navbar font sizes

The font sizes would sometimes appear too small
This commit is contained in:
Jonas_Jones 2023-10-14 22:15:50 +02:00
parent fc76f26440
commit 9506f2aa33

View file

@ -50,9 +50,7 @@
) { ) {
// If the value is an object and not empty, create a nested div // If the value is an object and not empty, create a nested div
html += ` html += `
<li><h${depth + 3} style='margin:0'><a href="/${currentPath}">${key}</a></h${ <li><h3 style='margin:0;font-size:${(1/(depth)+10)*2}px'><a href="/${currentPath}">${key}</a></h3></li>
depth + 3
}></li>
<ul> <ul>
${createHtmlList(obj[key], currentPath, depth + 1)} ${createHtmlList(obj[key], currentPath, depth + 1)}
</ul> </ul>
@ -70,12 +68,15 @@
let renderedList = createHtmlList(nestedFolders); let renderedList = createHtmlList(nestedFolders);
function filterObject(obj, filterString) { function filterObject(obj, filterString) {
if (filterString === '') { if (filterString === "") {
return obj; // If filterString is empty, return the original object return obj; // If filterString is empty, return the original object
} }
for (const key in obj) { for (const key in obj) {
if (typeof obj[key] === 'object' && Object.keys(obj[key]).length > 0) { if (
typeof obj[key] === "object" &&
Object.keys(obj[key]).length > 0
) {
obj[key] = filterObject(obj[key], filterString); obj[key] = filterObject(obj[key], filterString);
if (Object.keys(obj[key]).length === 0) { if (Object.keys(obj[key]).length === 0) {
delete obj[key]; // Remove the branch if it becomes empty after filtering delete obj[key]; // Remove the branch if it becomes empty after filtering