From 8896ffb29bab2472bfd031d53be9851181d95d22 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 6 Nov 2022 16:01:22 -0800 Subject: [PATCH] viewer: adjust scrollIntoView values --- src/components/Viewer.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index 11415577..839078af 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -429,9 +429,9 @@ export default class Viewer extends Mixins(GlobalMixin) { // Scroll to keep the thumbnail in view this.photoswipe.on("slideActivate", (e) => { const thumb = this.thumbElem(e.slide.data?.photo); - if (thumb) { + if (thumb && this.fullyOpened) { const rect = thumb.getBoundingClientRect(); - if (rect.top < 0 || rect.bottom > window.innerHeight) { + if (rect.bottom < 50 || rect.top > window.innerHeight - 50) { thumb.scrollIntoView({ block: "center", });