center selected gallery thumbnail
This commit is contained in:
parent
c8b38a5d11
commit
ea5d27a502
@ -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()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user