diff options
| author | Joe Mou <dev@mou.fo> | 2026-08-11 13:32:44 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-08-11 17:37:02 -0400 |
| commit | 866f99c414cb3d102483ce21c68a0e62b394baaa (patch) | |
| tree | 973b8e526bf51e8a05f6daab262d84035b7e2901 /cgithub/views/_nav.eta | |
| parent | 10f923b51e2844486651493b44974e418a2be6d9 (diff) | |
Keep the ref picker on the current view and path
Diffstat (limited to 'cgithub/views/_nav.eta')
| -rw-r--r-- | cgithub/views/_nav.eta | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cgithub/views/_nav.eta b/cgithub/views/_nav.eta index eb7ed42..a20fbbc 100644 --- a/cgithub/views/_nav.eta +++ b/cgithub/views/_nav.eta @@ -6,7 +6,7 @@ <button type="button" class="ref-selector-button branch" command="show-modal" commandfor="ref-selector-menu"> <img src="/static/icons/git-branch.svg" alt="branch" class="icon"> <%= refLabel %> ▾ </button> - <dialog class="ref-selector-menu" id="ref-selector-menu" closedby="any" data-owner="<%= it.repo.owner %>" data-repo="<%= it.repo.name %>"> + <dialog class="ref-selector-menu" id="ref-selector-menu" closedby="any" data-owner="<%= it.repo.owner %>" data-repo="<%= it.repo.name %>" data-view="<%= it.view %>"<% if (it.path && it.path !== "/") { %> data-path="<%= it.path %>"<% } %>> <div class="ref-selector-tabs"> <button type="button" class="active" data-ref-type="branches">Branches</button> <button type="button" data-ref-type="tags">Tags</button> @@ -22,7 +22,7 @@ currentPath += (currentPath ? '/' : '') + part; const isLast = i === pathParts.length - 1; if (isLast) { - %>/<%= part %><%= it.isTree ? "/" : "" %><% + %>/<%= part %><%= it.view === "tree" ? "/" : "" %><% } else { %>/<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/tree/<%= it.branch %>/<%= currentPath %>"><%= part %></a><% } |
