From 00722e6b761f7b4dea8743600f352b045b8cf72b Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 11 Mar 2022 01:39:45 +0000 Subject: [PATCH] client GlobalUI: use display name for navigation items --- src/static/js/ui/GlobalUI.mjs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/static/js/ui/GlobalUI.mjs b/src/static/js/ui/GlobalUI.mjs index 0e7bdc0..e9674ad 100644 --- a/src/static/js/ui/GlobalUI.mjs +++ b/src/static/js/ui/GlobalUI.mjs @@ -35,16 +35,19 @@ class GlobalUI { const result = document.createDocumentFragment(); for(const table_name of status.tables) { console.log(`[nav] new dynamic item ${table_name}, def`, tabledefs[table_name]); - const icondef = typeof tabledefs[table_name] === "undefined" - ? "question-circle" - : tabledefs[table_name].icon; + let icondef = `question-circle`; + let display_name = table_name; + if(typeof tabledefs[table_name] !== "undefined") { + icondef = tabledefs[table_name].icon; + display_name = tabledefs[table_name].name; + } const emel_icon = forkawesome_emel(icondef); console.log(`emel_icon`, emel_icon); result.append(this.emel(`li>a[href="?"]>${emel_icon}+span{?}`, { placeholders: [ `#table/${table_name}`, - table_name + display_name ] })); }