No need to search for old selected thumbnail.

This commit is contained in:
ccd0 2015-06-13 00:22:22 -07:00
parent 0def797cf9
commit 3da37b28a3

View File

@ -144,7 +144,7 @@ Gallery =
newID = +thumb.dataset.id
# Highlight, center selected thumbnail
$.rmClass el, 'gal-highlight' if el = $ '.gal-highlight', nodes.thumbs
$.rmClass el, 'gal-highlight' if el = Gallery.images[oldID]
$.addClass thumb, 'gal-highlight'
nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight/2 - nodes.thumbs.clientHeight/2