Skip to content

Commit

Permalink
Add scroll-margin-top to account for sticky header (#16269)
Browse files Browse the repository at this point in the history
Fixes #16263

Co-authored-by: zeripath <art27@cantab.net>
  • Loading branch information
jpraet and zeripath authored Jun 27, 2021
1 parent f533b5d commit eee03ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ function initPullRequestReview() {
$(`#code-comments-${id}`).removeClass('hide');
$(`#code-preview-${id}`).removeClass('hide');
$(`#hide-outdated-${id}`).removeClass('hide');
$(window).scrollTop(commentDiv.offset().top);
commentDiv[0].scrollIntoView();
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions web_src/less/_review.less
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,11 @@ a.blob-excerpt:hover {
.review-box > .segment {
border: none !important;
}

.pull.files.diff [id] {
scroll-margin-top: 99px;

@media @mediaMdAndDown {
scroll-margin-top: 130px;
}
}

0 comments on commit eee03ae

Please sign in to comment.