mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Scroll collapsed file into view (#23702)
This commit is contained in:
		| @@ -8,6 +8,9 @@ import {svg} from '../svg.js'; | ||||
| export function setFileFolding(fileContentBox, foldArrow, newFold) { | ||||
|   foldArrow.innerHTML = svg(`octicon-chevron-${newFold ? 'right' : 'down'}`, 18); | ||||
|   fileContentBox.setAttribute('data-folded', newFold); | ||||
|   if (newFold && fileContentBox.getBoundingClientRect().top < 0) { | ||||
|     fileContentBox.scrollIntoView(); | ||||
|   } | ||||
| } | ||||
|  | ||||
| // Like `setFileFolding`, except that it automatically inverts the current file folding state. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user