From 7440f1e4526532050243e37ba074bc4d28adf3a1 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 3 Oct 2026 22:58:45 +0800 Subject: [PATCH] fix: make navbar stopwatch button can show popup (#39562) regression: https://github.com/go-gitea/gitea/pull/36965#pullrequestreview-5400326165 partially backport the "href" fix from #39554 --- templates/base/head_navbar_icons.tmpl | 2 +- web_src/js/features/stopwatch.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/base/head_navbar_icons.tmpl b/templates/base/head_navbar_icons.tmpl index b6a2ef1020d..7a88650c0e5 100644 --- a/templates/base/head_navbar_icons.tmpl +++ b/templates/base/head_navbar_icons.tmpl @@ -4,7 +4,7 @@ {{- $activeStopwatch := call $data.GetActiveStopwatch -}} {{- $notificationUnreadCount := call $data.GetNotificationUnreadCount -}} {{/* always rendered so a real-time push can reveal it without a reload */}} - +
{{svg "octicon-stopwatch"}} diff --git a/web_src/js/features/stopwatch.ts b/web_src/js/features/stopwatch.ts index 63dabbd3335..1af0894d54e 100644 --- a/web_src/js/features/stopwatch.ts +++ b/web_src/js/features/stopwatch.ts @@ -93,7 +93,6 @@ function updateStopwatchData(data: Array) { } else { const {repo_owner_name, repo_name, issue_index, seconds} = watch; const issueUrl = `${appSubUrl}/${repo_owner_name}/${repo_name}/issues/${issue_index}`; - for (const btnEl of btnEls) btnEl.setAttribute('href', issueUrl); document.querySelector('.stopwatch-link')?.setAttribute('href', issueUrl); document.querySelector('.stopwatch-commit')?.setAttribute('action', `${issueUrl}/times/stopwatch/stop`); document.querySelector('.stopwatch-cancel')?.setAttribute('action', `${issueUrl}/times/stopwatch/cancel`);