From 2144430d7165300966660af40fe5579d6d402ef0 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 16 Sep 2014 15:25:34 -0700 Subject: [PATCH] Fix gallery opening - when there are no images - when we have scrolled past the last image --- src/Images/Gallery.coffee | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 4dad7350c..f9ec10794 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -83,10 +83,9 @@ Gallery = nodes.thumbs.scrollTop = 0 nodes.current.parentElement.scrollTop = 0 - Gallery.open if image - $("[href='#{image.href}']", nodes.thumbs) or Gallery.images[0] - else - Gallery.images[0] + thumb = $ "[href='#{image.href}']", nodes.thumbs if image + thumb or= Gallery.images[Gallery.images.length-1] + Gallery.open thumb if thumb doc.style.overflow = 'hidden' nodes.total.textContent = Gallery.images.length