Multifile support for ImageCommon.cache. #2171

This commit is contained in:
ccd0 2019-07-15 13:27:16 -07:00
parent b588ca43fd
commit 829ef77159
2 changed files with 4 additions and 4 deletions

View File

@ -168,14 +168,14 @@ ImageExpand =
if file.fullImage
el = file.fullImage
else if ImageCommon.cache?.dataset.fullID is post.fullID
else if ImageCommon.cache?.dataset.fileID is "#{post.fullID}.#{file.index}"
el = file.fullImage = ImageCommon.popCache()
$.on el, 'error', ImageExpand.error
ImageCommon.rewind el if Conf['Restart when Opened'] and el.id isnt 'ihover'
el.removeAttribute 'id'
else
el = file.fullImage = $.el (if isVideo then 'video' else 'img')
el.dataset.fullID = post.fullID
el.dataset.fileID = "#{post.fullID}.#{file.index}"
$.on el, 'error', ImageExpand.error
el.src = src or file.url

View File

@ -24,12 +24,12 @@ ImageHover =
{isVideo} = file
return if file.isExpanding or file.isExpanded or g.SITE.isThumbExpanded?(file)
error = ImageHover.error post, file
if ImageCommon.cache?.dataset.fullID is post.fullID
if ImageCommon.cache?.dataset.fileID is "#{post.fullID}.#{file.index}"
el = ImageCommon.popCache()
$.on el, 'error', error
else
el = $.el (if isVideo then 'video' else 'img')
el.dataset.fullID = post.fullID
el.dataset.fileID = "#{post.fullID}.#{file.index}"
$.on el, 'error', error
el.src = file.url