Skip to content

Commit df1975e

Browse files
committed
Add scroll-margin-top to account for sticky header
1 parent f533b5d commit df1975e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

web_src/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ function initPullRequestReview() {
13431343
$(`#code-comments-${id}`).removeClass('hide');
13441344
$(`#code-preview-${id}`).removeClass('hide');
13451345
$(`#hide-outdated-${id}`).removeClass('hide');
1346-
$(window).scrollTop(commentDiv.offset().top);
1346+
commentDiv[0].scrollIntoView();
13471347
}
13481348
}
13491349
}

web_src/less/_review.less

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,15 @@ a.blob-excerpt:hover {
173173
.review-box > .segment {
174174
border: none !important;
175175
}
176+
177+
.pull.files.diff [id] {
178+
scroll-margin-top: 99px;
179+
180+
@media @mediaMd {
181+
scroll-margin-top: 130px;
182+
}
183+
184+
@media @mediaSm {
185+
scroll-margin-top: 130px;
186+
}
187+
}

0 commit comments

Comments
 (0)