mirror of
https://github.com/JonasunderscoreJones/wiki.jonasjones.dev.git
synced 2025-10-23 06:09:18 +02:00
Fixed Navbar font sizes
The font sizes would sometimes appear too small
This commit is contained in:
parent
fc76f26440
commit
9506f2aa33
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue