Revert "Revert "Fix iframes from Embedding being reloaded when switching to catalog.""
This reverts commit c2560fe1f105a6a7dd48408b79a61271d8274de6.
This commit is contained in:
parent
21fc243c6d
commit
2f71c27b5a
@ -11,6 +11,8 @@ Index =
|
|||||||
|
|
||||||
return unless Conf['JSON Index']
|
return unless Conf['JSON Index']
|
||||||
|
|
||||||
|
@enabled = true
|
||||||
|
|
||||||
Callbacks.Post.push
|
Callbacks.Post.push
|
||||||
name: 'Index Page Numbers'
|
name: 'Index Page Numbers'
|
||||||
cb: @node
|
cb: @node
|
||||||
|
|||||||
@ -55,6 +55,7 @@ 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]
|
||||||
|
|
||||||
if Conf['Auto-embed'] and !Conf['Floating Embeds'] and !post.isFetchedQuote
|
if Conf['Auto-embed'] and !Conf['Floating Embeds'] and !post.isFetchedQuote
|
||||||
@ -146,6 +147,12 @@ Embedding =
|
|||||||
|
|
||||||
return container
|
return container
|
||||||
|
|
||||||
|
catalogRemove: ->
|
||||||
|
isCatalog = $.hasClass(doc, 'catalog-mode')
|
||||||
|
if (isCatalog and $.hasClass(@, 'embedded')) or (!isCatalog and $.hasClass(@, 'embed-removed'))
|
||||||
|
Embedding.cb.toggle.call @
|
||||||
|
$.toggleClass @, 'embed-removed'
|
||||||
|
|
||||||
title: (req, data) ->
|
title: (req, data) ->
|
||||||
{key, uid, options, link, post} = data
|
{key, uid, options, link, post} = data
|
||||||
{status} = req
|
{status} = req
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user