mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/sidebar: highlight the category tab even on subpages
This commit is contained in:
parent
eb12fa631b
commit
e305c99b94
1 changed files with 4 additions and 1 deletions
|
@ -13,7 +13,10 @@
|
|||
|
||||
let tab: HTMLElement;
|
||||
|
||||
$: isTabActive = $page.url.pathname === tabLink;
|
||||
$: currentTab = $page.url.pathname.split('/')[1];
|
||||
$: baseTabPath = tabLink.split('/')[1]
|
||||
|
||||
$: isTabActive = currentTab === baseTabPath;
|
||||
|
||||
const showTab = (e: HTMLElement | undefined) => {
|
||||
if (e) {
|
||||
|
|
Loading…
Reference in a new issue