mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-28 13:20:20 +08: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