summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2021-06-27 16:36:49 +0200
committerGitHub <noreply@github.com>2021-06-27 15:36:49 +0100
commiteee03ae90a17242b481677a2f575e18e449de683 (patch)
treeec6fe23f7664c9d5131fedae32fd526c43c8e016 /web_src
parentf533b5d5cf5178adf7f8f968cd7ded45c00ad9e6 (diff)
downloadgitea-eee03ae90a17242b481677a2f575e18e449de683.tar.gz
gitea-eee03ae90a17242b481677a2f575e18e449de683.zip
Add scroll-margin-top to account for sticky header (#16269)
Fixes #16263 Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/index.js2
-rw-r--r--web_src/less/_review.less8
2 files changed, 9 insertions, 1 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index c00b3aaeb0..67548f5d9d 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -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();
}
}
}
diff --git a/web_src/less/_review.less b/web_src/less/_review.less
index 9197050913..2b15eec82d 100644
--- a/web_src/less/_review.less
+++ b/web_src/less/_review.less
@@ -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;
+ }
+}