mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	Fix the wrong line number in the diff view page when expanded twice. (#31431)
close #31149, regression of #29385 (incorrect `data-query=`)
This commit is contained in:
		@@ -53,17 +53,17 @@
 | 
				
			|||||||
			<td colspan="2" class="lines-num">
 | 
								<td colspan="2" class="lines-num">
 | 
				
			||||||
				<div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}">
 | 
									<div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}">
 | 
				
			||||||
					{{if or (eq $expandDirection 3) (eq $expandDirection 5)}}
 | 
										{{if or (eq $expandDirection 3) (eq $expandDirection 5)}}
 | 
				
			||||||
						<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}}">
 | 
											<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}}">
 | 
				
			||||||
							{{svg "octicon-fold-down"}}
 | 
												{{svg "octicon-fold-down"}}
 | 
				
			||||||
						</button>
 | 
											</button>
 | 
				
			||||||
					{{end}}
 | 
										{{end}}
 | 
				
			||||||
					{{if or (eq $expandDirection 3) (eq $expandDirection 4)}}
 | 
										{{if or (eq $expandDirection 3) (eq $expandDirection 4)}}
 | 
				
			||||||
						<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}}">
 | 
											<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}}">
 | 
				
			||||||
							{{svg "octicon-fold-up"}}
 | 
												{{svg "octicon-fold-up"}}
 | 
				
			||||||
						</button>
 | 
											</button>
 | 
				
			||||||
					{{end}}
 | 
										{{end}}
 | 
				
			||||||
					{{if eq $expandDirection 2}}
 | 
										{{if eq $expandDirection 2}}
 | 
				
			||||||
						<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}}">
 | 
											<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}}">
 | 
				
			||||||
							{{svg "octicon-fold"}}
 | 
												{{svg "octicon-fold"}}
 | 
				
			||||||
						</button>
 | 
											</button>
 | 
				
			||||||
					{{end}}
 | 
										{{end}}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user