center selected gallery thumbnail

This commit is contained in:
ccd0 2014-07-05 12:27:13 -07:00
parent c8b38a5d11
commit ea5d27a502

View File

@ -157,14 +157,8 @@ Gallery =
nodes.next.focus() nodes.next.focus()
Gallery.cb.setupTimer() if Gallery.slideshow Gallery.cb.setupTimer() if Gallery.slideshow
# Scroll # Center selected thumbnail
rect = @getBoundingClientRect() nodes.thumbs.scrollTop = @offsetTop + @offsetHeight/2 - nodes.thumbs.clientHeight/2
{top} = rect
if top > 0
top += rect.height - doc.clientHeight
return if top < 0
nodes.thumbs.scrollTop += top
image: (e) -> image: (e) ->
e.preventDefault() e.preventDefault()