Don't run catalog embed removal on pruned posts.
This commit is contained in:
parent
a6bee204e4
commit
68f123d3fa
@ -9,7 +9,12 @@ Embedding =
|
|||||||
<%= readHTML('Embed.html') %>
|
<%= readHTML('Embed.html') %>
|
||||||
@media = $ '#media-embed', @dialog
|
@media = $ '#media-embed', @dialog
|
||||||
$.one d, '4chanXInitFinished', @ready
|
$.one d, '4chanXInitFinished', @ready
|
||||||
|
$.on d, 'IndexRefreshInternal', ->
|
||||||
|
g.posts.forEach (post) ->
|
||||||
|
for post in [post, post.clones...]
|
||||||
|
for embed in post.nodes.embedlinks
|
||||||
|
Embedding.cb.catalogRemove.call embed
|
||||||
|
return
|
||||||
if Conf['Link Title']
|
if Conf['Link Title']
|
||||||
$.on d, '4chanXInitFinished PostsInserted', ->
|
$.on d, '4chanXInitFinished PostsInserted', ->
|
||||||
for key, service of Embedding.types when service.title?.batchSize
|
for key, service of Embedding.types when service.title?.batchSize
|
||||||
@ -55,8 +60,8 @@ Embedding =
|
|||||||
embed.dataset[name] = value for name, value of {key, uid, options, href}
|
embed.dataset[name] = value for name, value of {key, uid, options, href}
|
||||||
|
|
||||||
$.on embed, 'click', Embedding.cb.click
|
$.on embed, 'click', Embedding.cb.click
|
||||||
$.on d, 'IndexRefreshInternal', Embedding.cb.catalogRemove.bind(embed) if Index.enabled
|
|
||||||
$.after link, [$.tn(' '), embed]
|
$.after link, [$.tn(' '), embed]
|
||||||
|
post.nodes.embedlinks.push embed
|
||||||
|
|
||||||
if Conf['Auto-embed'] and !Conf['Floating Embeds'] and !post.isFetchedQuote
|
if Conf['Auto-embed'] and !Conf['Floating Embeds'] and !post.isFetchedQuote
|
||||||
if $.hasClass(doc, 'catalog-mode')
|
if $.hasClass(doc, 'catalog-mode')
|
||||||
|
|||||||
@ -85,6 +85,7 @@ class Post
|
|||||||
comment: $ '.postMessage', post
|
comment: $ '.postMessage', post
|
||||||
quotelinks: []
|
quotelinks: []
|
||||||
archivelinks: []
|
archivelinks: []
|
||||||
|
embedlinks: []
|
||||||
|
|
||||||
# XXX Edge invalidates HTMLCollections when an ancestor node is inserted into another node.
|
# XXX Edge invalidates HTMLCollections when an ancestor node is inserted into another node.
|
||||||
# https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7560353/
|
# https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7560353/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user