From 12be09d39ab4b80ab71cb02a425e2717da805620 Mon Sep 17 00:00:00 2001 From: sunhao Date: Mon, 31 Jul 2023 17:48:32 +0800 Subject: [PATCH] * active current theme item in user menu. --- lib/zin/wg/header/v1.php | 1 + www/js/zui3/zin.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/zin/wg/header/v1.php b/lib/zin/wg/header/v1.php index 9abcfcf787..bdb4d7c48c 100644 --- a/lib/zin/wg/header/v1.php +++ b/lib/zin/wg/header/v1.php @@ -219,6 +219,7 @@ class header extends wg ( 'text' => $lang->theme, 'icon' => 'theme', + 'key' => 'theme', 'items' => $themeItems ); diff --git a/www/js/zui3/zin.js b/www/js/zui3/zin.js index dc0cb06ce0..45f5c7f499 100644 --- a/www/js/zui3/zin.js +++ b/www/js/zui3/zin.js @@ -910,6 +910,11 @@ oldPath.pop(); oldPath.push(theme + '.css'); $theme.attr('href', oldPath.join('/')); + const userMenu = $('#userMenu-toggle').zui(); + if(!userMenu) return; + const themeItem = userMenu.options.menu.items.find(x => x.key === 'theme'); + themeItem.items.forEach(item => {item.active = item['data-value'] === theme;}); + userMenu.render({menu: userMenu.options.menu}); } /**