mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 20:21:47 +01:00 
			
		
		
		
	Backport #31431 by @charles7668 close #31149 The problem is caused by the `data-query=` string affecting the parsing of the `last_left` parameter. When the page is first rendered, `data-query=` does not exist. However, after clicking expand, the returned HTML contains this string, causing the line numbers to start from 1 upon expanding a second time. before fix  after fix  Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									b83482b4ba
								
							
						
					
					
						commit
						a4f977e00b
					
				| @ -53,17 +53,17 @@ | ||||
| 			<td colspan="2" class="lines-num"> | ||||
| 				<div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}"> | ||||
| 					{{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"}} | ||||
| 						</button> | ||||
| 					{{end}} | ||||
| 					{{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"}} | ||||
| 						</button> | ||||
| 					{{end}} | ||||
| 					{{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"}} | ||||
| 						</button> | ||||
| 					{{end}} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user