From 2ad27897fe31af61d3b4cedb2b1fe84c1da59f96 Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 14 Mar 2022 19:48:26 +0100 Subject: [PATCH] Implement "href" options in menu config --- web/src/_templates/app/js.php | 2 +- web/src/app/js/app.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/_templates/app/js.php b/web/src/_templates/app/js.php index 0f17fe6..68946cd 100644 --- a/web/src/_templates/app/js.php +++ b/web/src/_templates/app/js.php @@ -29,7 +29,7 @@ app.menus = { maxwidth: 35, items: [ { text: 's:nav.profile', fa: 'user', - onclick: "alert('user')" }, + href: "settings/profile" }, { separator: true }, ], }, diff --git a/web/src/app/js/app.js b/web/src/app/js/app.js index 5774721..161d835 100644 --- a/web/src/app/js/app.js +++ b/web/src/app/js/app.js @@ -52,6 +52,8 @@ app.menu = { item.isItem = item.separator === undefined; item.isSep = item.separator === true; item.class = item.class || ''; + if (item.href !== undefined && item.onclick === undefined) + item.onclick = "hashredir('"+item.href+"')"; content += app.template.fill(item, v); } return content;