Skip to content

Commit c60ef94

Browse files
authored
Fix the wrong line number in the diff view page when expanded twice. (#31431)
close #31149, regression of #29385 (incorrect `data-query=`)
1 parent 5afafe2 commit c60ef94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/repo/diff/blob_excerpt.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@
5353
<td colspan="2" class="lines-num">
5454
<div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}">
5555
{{if or (eq $expandDirection 3) (eq $expandDirection 5)}}
56-
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
56+
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
5757
{{svg "octicon-fold-down"}}
5858
</button>
5959
{{end}}
6060
{{if or (eq $expandDirection 3) (eq $expandDirection 4)}}
61-
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
61+
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
6262
{{svg "octicon-fold-up"}}
6363
</button>
6464
{{end}}
6565
{{if eq $expandDirection 2}}
66-
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
66+
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
6767
{{svg "octicon-fold"}}
6868
</button>
6969
{{end}}

0 commit comments

Comments
 (0)