Skip to content

Commit 0a73095

Browse files
committed
remove unnecessary
1 parent 21590cc commit 0a73095

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web_src/js/features/file-fold.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ import {svg} from '../svg.js';
77
//
88
export function setFileFolding(fileContentBox, foldArrow, newFold, isFromViewed = false) {
99
const diffFileHeader = fileContentBox.querySelector('.diff-file-header');
10-
const isFolded = fileContentBox.getAttribute('data-folded');
11-
console.log('newFold', newFold)
10+
console.log('newFold:', newFold)
1211
foldArrow.innerHTML = svg(`octicon-chevron-${newFold ? 'right' : 'down'}`, 18);
1312
fileContentBox.setAttribute('data-folded', newFold);
1413
// scroll position needs to be adjusted only when folding the file
1514
// and scrollY is greater than current file header's offsetTop
16-
if (isFolded === 'false' && window.scrollY > diffFileHeader.offsetTop) {
15+
if (newFold === 'true' && window.scrollY > diffFileHeader.offsetTop) {
1716
// if the file is folded by clicking the "fold file" icon, scroll to current file header
1817
let scrollTargetoffsetTop = fileContentBox.offsetTop;
1918
if (isFromViewed) {
@@ -29,6 +28,7 @@ export function setFileFolding(fileContentBox, foldArrow, newFold, isFromViewed
2928
}
3029

3130
// Like `setFileFolding`, except that it automatically inverts the current file folding state.
32-
export function invertFileFolding(fileContentBox, foldArrow) {
31+
export function invertFileFolding(fileContentBox, foldArrow) {
3332
setFileFolding(fileContentBox, foldArrow, fileContentBox.getAttribute('data-folded') !== 'true');
3433
}
34+

0 commit comments

Comments
 (0)