Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ <h2 class="text-2xl font-bold">TimeHarbor</h2>
<a href="/" class="btn btn-ghost hover:bg-primary-focus">Home</a>
<a href="/teams" class="btn btn-ghost hover:bg-primary-focus">Teams</a>
<a href="/tickets" class="btn btn-ghost hover:bg-primary-focus">Projects</a>
<a href="https://github.com/mieweb/timeharbor/issues/new" target="_blank" rel="noopener noreferrer" class="btn btn-ghost hover:bg-primary-focus">Report an Issue</a>
</nav>
</header>
<main class="container mx-auto px-4">
Expand Down
11 changes: 8 additions & 3 deletions client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ Template.mainLayout.helpers({

Template.mainLayout.events({
'click nav a'(event) {
event.preventDefault();
const target = event.currentTarget.getAttribute('href').substring(1);
currentTemplate.set(target || 'home');
const href = event.currentTarget.getAttribute('href');
// Only handle internal navigation links (starting with /)
// Let external links (starting with http) work normally
if (href && href.startsWith('/')) {
event.preventDefault();
const target = href.substring(1);
currentTemplate.set(target || 'home');
}
},
});

Expand Down