k
This commit is contained in:
@@ -18610,6 +18610,7 @@ a.lazy-thumb.filtered-upload-ghost:hover::after {
|
||||
/* Prevent scrolling on background document when Onara modal is active */
|
||||
body.onara-modal-open {
|
||||
overflow: hidden !important;
|
||||
scrollbar-gutter: stable !important;
|
||||
}
|
||||
|
||||
/* Background main page elements (outside posts) are dimmed and softly blurred */
|
||||
|
||||
@@ -1100,9 +1100,11 @@ window.cancelAnimFrame = (function () {
|
||||
targetThumb.classList.add('onara-active');
|
||||
const rect = targetThumb.getBoundingClientRect();
|
||||
const navbarH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-h')) || 50;
|
||||
const isInView = rect.top >= navbarH && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight);
|
||||
if (!isInView) {
|
||||
targetThumb.scrollIntoView({ block: 'center', inline: 'nearest', behavior: 'instant' });
|
||||
const vh = window.innerHeight || document.documentElement.clientHeight;
|
||||
// If any part of the thumbnail is already visible in the viewport, do not scroll
|
||||
const isVisible = rect.bottom > navbarH && rect.top < vh;
|
||||
if (!isVisible) {
|
||||
targetThumb.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'instant' });
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1216,6 +1218,7 @@ window.cancelAnimFrame = (function () {
|
||||
'.nav-prev',
|
||||
'.nav-next',
|
||||
'#random',
|
||||
'.steuerung',
|
||||
'.location',
|
||||
'.item_title',
|
||||
'.blahlol',
|
||||
|
||||
Reference in New Issue
Block a user