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()
Gallery.cb.setupTimer() if Gallery.slideshow
# Scroll
rect = @getBoundingClientRect()
{top} = rect
if top > 0
top += rect.height - doc.clientHeight
return if top < 0
nodes.thumbs.scrollTop += top
# Center selected thumbnail
nodes.thumbs.scrollTop = @offsetTop + @offsetHeight/2 - nodes.thumbs.clientHeight/2
image: (e) ->
e.preventDefault()