tweak image hover vertical position

This commit is contained in:
ccd0 2014-09-16 18:23:53 -07:00
parent 5e1b8a8f7c
commit 34abd80267

View File

@ -341,13 +341,10 @@ UI = do ->
height = @el.offsetHeight
{clientX, clientY} = e
top = clientY - 120
top = if @clientHeight <= height or top <= 0
0
else if top + height >= @clientHeight
@clientHeight - height
top = if @isImage
Math.max 0, clientY * (@clientHeight - height) / @clientHeight
else
top
Math.max 0, Math.min(@clientHeight - height, clientY - 120)
threshold = @clientWidth / 2
threshold = Math.max threshold, @clientWidth - 400 unless @isImage