diff options
Diffstat (limited to 'web_src/js/features')
-rw-r--r-- | web_src/js/features/file-fold.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/web_src/js/features/file-fold.js b/web_src/js/features/file-fold.js index 0d5be7cf60..8321b9b19e 100644 --- a/web_src/js/features/file-fold.js +++ b/web_src/js/features/file-fold.js @@ -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. |