Don't let link URL preview cover quote preview.

This commit is contained in:
ccd0 2015-12-12 15:24:28 -08:00
parent b07c215d62
commit 77142c23db
2 changed files with 5 additions and 4 deletions

View File

@ -341,9 +341,11 @@ UI = do ->
o.workaround = (e) -> o.hoverend(e) unless root.contains e.target
$.on doc, 'mousemove', o.workaround
hoverstart.padding = 25
hover = (e) ->
@latestEvent = e
height = @height or @el.offsetHeight
height = (@height or @el.offsetHeight) + hoverstart.padding
{clientX, clientY} = e
top = if @isImage

View File

@ -46,9 +46,8 @@ ImageHover =
el.play() if Conf['Autoplay']
[width, height] = (+x for x in file.dimensions.split 'x')
{left, right} = @getBoundingClientRect()
padding = 25
maxWidth = Math.max left, doc.clientWidth - right
maxHeight = doc.clientHeight - padding
maxHeight = doc.clientHeight - UI.hover.padding
scale = Math.min 1, maxWidth / width, maxHeight / height
el.style.maxWidth = "#{scale * width}px"
el.style.maxHeight = "#{scale * height}px"
@ -57,7 +56,7 @@ ImageHover =
el: el
latestEvent: e
endEvents: 'mouseout click'
height: scale * height + padding
height: scale * height
noRemove: true
cb: ->
$.off el, 'error', error