fix: title link wired via JS goHome() — switches to downloads, closes status, resets showAll
This commit is contained in:
@@ -35,6 +35,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
document.getElementById('logout-btn').addEventListener('click', handleLogout);
|
document.getElementById('logout-btn').addEventListener('click', handleLogout);
|
||||||
document.getElementById('show-all-toggle').addEventListener('change', handleShowAllToggle);
|
document.getElementById('show-all-toggle').addEventListener('change', handleShowAllToggle);
|
||||||
document.getElementById('status-btn').addEventListener('click', toggleStatusPanel);
|
document.getElementById('status-btn').addEventListener('click', toggleStatusPanel);
|
||||||
|
document.getElementById('title-home-link').addEventListener('click', e => { e.preventDefault(); goHome(); });
|
||||||
});
|
});
|
||||||
|
|
||||||
function loadAppVersion() {
|
function loadAppVersion() {
|
||||||
@@ -64,6 +65,18 @@ function setTheme(theme) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function goHome() {
|
||||||
|
closeStatusPanel();
|
||||||
|
// Reset showAll if active
|
||||||
|
if (showAll) {
|
||||||
|
showAll = false;
|
||||||
|
const toggle = document.getElementById('show-all-toggle');
|
||||||
|
if (toggle) toggle.checked = false;
|
||||||
|
startSSE();
|
||||||
|
}
|
||||||
|
activateTab('downloads', true);
|
||||||
|
}
|
||||||
|
|
||||||
function initTabs() {
|
function initTabs() {
|
||||||
const savedTab = localStorage.getItem('sofarr-active-tab') || 'downloads';
|
const savedTab = localStorage.getItem('sofarr-active-tab') || 'downloads';
|
||||||
activateTab(savedTab, false);
|
activateTab(savedTab, false);
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@
|
|||||||
<!-- Dashboard -->
|
<!-- Dashboard -->
|
||||||
<div id="dashboard-container" class="dashboard-container" style="display: none;">
|
<div id="dashboard-container" class="dashboard-container" style="display: none;">
|
||||||
<header class="app-header">
|
<header class="app-header">
|
||||||
<h1><a href="#" class="title-link" onclick="activateTab('downloads',true);closeStatusPanel();return false;"><img src="favicon-192.png" alt="" class="title-logo">sofarr</a></h1>
|
<h1><a href="#" class="title-link" id="title-home-link"><img src="favicon-192.png" alt="" class="title-logo">sofarr</a></h1>
|
||||||
<div class="header-controls">
|
<div class="header-controls">
|
||||||
<div class="theme-switcher">
|
<div class="theme-switcher">
|
||||||
<button class="theme-btn active" data-theme="light">Light</button>
|
<button class="theme-btn active" data-theme="light">Light</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user