mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-22 13:15:49 +00:00
Use anchor tags for dashboard sidebar items
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
This commit is contained in:
@@ -99,10 +99,12 @@ async function UIDashboard (options) {
|
||||
continue;
|
||||
}
|
||||
const isActive = i === 0 ? ' active' : '';
|
||||
h += `<div class="dashboard-sidebar-item${isActive}" data-section="${tab.id}" data-tooltip="${html_encode(tab.label)}">`;
|
||||
const tabHash = tab.id === 'home' ? '' : `#${tab.id}`;
|
||||
const tabHref = tabHash || window.location.pathname;
|
||||
h += `<a class="dashboard-sidebar-item allow-native-ctxmenu${isActive}" href="${tabHref}" data-section="${tab.id}" data-tooltip="${html_encode(tab.label)}">`;
|
||||
h += tab.icon;
|
||||
h += tab.label;
|
||||
h += '</div>';
|
||||
h += '</a>';
|
||||
}
|
||||
h += '</div>';
|
||||
|
||||
@@ -391,7 +393,8 @@ async function UIDashboard (options) {
|
||||
window.addEventListener('popstate', handleRouteChange);
|
||||
|
||||
// Sidebar item click handler
|
||||
$el_window.on('click', '.dashboard-sidebar-item', function () {
|
||||
$el_window.on('click', '.dashboard-sidebar-item', function (e) {
|
||||
e.preventDefault();
|
||||
const $this = $(this);
|
||||
const section = $this.attr('data-section');
|
||||
|
||||
|
||||
@@ -352,6 +352,7 @@ body {
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
color: var(--dashboard-text);
|
||||
text-decoration: none;
|
||||
transition: background-color 0.15s;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user