more hover fixes
This commit is contained in:
parent
8bf3608a35
commit
582992a093
@ -13,15 +13,17 @@ ImageHover =
|
|||||||
{file} = post
|
{file} = post
|
||||||
{isVideo} = file
|
{isVideo} = file
|
||||||
if el = file.fullImage
|
if el = file.fullImage
|
||||||
|
return if el.id is 'ihover'
|
||||||
|
el.id = 'ihover'
|
||||||
TrashQueue.remove el
|
TrashQueue.remove el
|
||||||
else
|
else
|
||||||
el = $.el (if isVideo then 'video' else 'img'),
|
file.fullImage = el = $.el (if isVideo then 'video' else 'img'),
|
||||||
className: 'full-image'
|
className: 'full-image'
|
||||||
src: file.URL
|
id: 'ihover'
|
||||||
file.fullImage = el
|
el.dataset.fullID = post.fullID
|
||||||
$.after file.thumb, el unless el is file.thumb.nextSibling
|
$.on el, 'error', ImageHover.error
|
||||||
el.id = 'ihover'
|
el.src = file.URL
|
||||||
el.dataset.fullID = post.fullID
|
$.after file.thumb, el
|
||||||
if isVideo
|
if isVideo
|
||||||
el.loop = true
|
el.loop = true
|
||||||
el.controls = false
|
el.controls = false
|
||||||
@ -31,7 +33,7 @@ ImageHover =
|
|||||||
el: el
|
el: el
|
||||||
latestEvent: e
|
latestEvent: e
|
||||||
endEvents: 'mouseout click'
|
endEvents: 'mouseout click'
|
||||||
asapTest: -> (if isVideo then el.videoHeight else el.naturalHeight)
|
asapTest: -> (if isVideo then el.readyState >= el.HAVE_CURRENT_DATA else el.naturalHeight)
|
||||||
noRemove: true
|
noRemove: true
|
||||||
cb: ->
|
cb: ->
|
||||||
$.off el, 'error', ImageHover.error
|
$.off el, 'error', ImageHover.error
|
||||||
@ -39,7 +41,6 @@ ImageHover =
|
|||||||
el.pause()
|
el.pause()
|
||||||
TrashQueue.add el, post
|
TrashQueue.add el, post
|
||||||
el.removeAttribute 'id'
|
el.removeAttribute 'id'
|
||||||
$.on el, 'error', ImageHover.error
|
|
||||||
error: ->
|
error: ->
|
||||||
return unless doc.contains @
|
return unless doc.contains @
|
||||||
post = g.posts[@dataset.fullID]
|
post = g.posts[@dataset.fullID]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user