forked from forgejo/forgejo
Scroll collapsed file into view (#23702)
This commit is contained in:
parent
0983b237d5
commit
54197b67f9
3 changed files with 12 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue