Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scroll-margin-top to account for sticky header #16269

Merged
merged 2 commits into from
Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 12 additions & 0 deletions web_src/less/_review.less
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,15 @@ a.blob-excerpt:hover {
.review-box > .segment {
border: none !important;
}

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

@media @mediaMd {
zeripath marked this conversation as resolved.
Show resolved Hide resolved
scroll-margin-top: 130px;
}

@media @mediaSm {
Copy link
Member

@noerw noerw Jun 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add @mediaMdAndDown to variables.less and merge these blocks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There already is a @mediaMdAndDown...

scroll-margin-top: 130px;
}
zeripath marked this conversation as resolved.
Show resolved Hide resolved
}