Adjust scrolling to keep Edit heading visible (#42684, #43143).

Patch by Mizuki ISHIKAWA (user:ishikawa999).


git-svn-id: https://svn.redmine.org/redmine/trunk@23970 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2025-09-11 04:05:19 +00:00
parent 8b0c5c0ba5
commit e1129f237d
3 changed files with 9 additions and 6 deletions

View File

@@ -23,11 +23,12 @@ function toggleCheckboxesBySelector(selector) {
}
function showAndScrollTo(id, focus) {
$('#'+id).show();
if (focus !== null) {
$('#'+focus).focus();
const el = document.getElementById(id);
if (el) {
el.style.display = ''; // show()
if (focus) document.getElementById(focus)?.focus({ preventScroll: true });
el.scrollIntoView({ behavior: 'instant' });
}
$('html, body').animate({scrollTop: $('#'+id).offset().top}, 100);
}
function toggleRowGroup(el) {

View File

@@ -796,7 +796,8 @@ div#issue-changesets p { margin-top: 0; margin-bottom: 1em;}
/* Prevent content from being hidden behind a #sticky-issue-header when scrolling via anchor links. */
.controller-issues.action-show div.wiki a[name],
.controller-issues.action-show #history div[id^="note-"],
.controller-issues.action-show #history div[id^="change-"] {
.controller-issues.action-show #history div[id^="change-"],
.controller-issues.action-show #update {
scroll-margin-top: 50px;
}

View File

@@ -868,7 +868,8 @@
/* Prevent content from being hidden behind #sticky-issue-header and project-jump when scrolling via anchor links. */
.controller-issues.action-show div.wiki a[name],
.controller-issues.action-show #history div[id^="note-"],
.controller-issues.action-show #history div[id^="change-"] {
.controller-issues.action-show #history div[id^="change-"],
.controller-issues.action-show #update {
scroll-margin-top: 114px;
}
}