From 0fa82353f4c21b4cf4a7a47eb3e1fa30987d08ee Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 16 Aug 2014 13:16:00 -0700 Subject: [PATCH] fix bug in opening gallery to current image when image was expanded --- src/Images/Gallery.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index cf47158b4..bc5f85d57 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -75,9 +75,9 @@ Gallery = Gallery.generateThumb post # If no image to open is given, pick image we have scrolled to. if !image and Gallery.fullIDs[post.fullID] - {thumb} = post.file - if Header.getTopOf(thumb) + thumb.getBoundingClientRect().height >= 0 - image = thumb.parentNode + candidate = post.file.thumb.parentNode + if Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0 + image = candidate $.add d.body, dialog nodes.thumbs.scrollTop = 0