Make (unembed) link still work if switched to Floating Embeds without reloading.

This commit is contained in:
ccd0 2016-11-26 03:17:17 -08:00
parent 68f123d3fa
commit 5cc930f67d

View File

@ -122,7 +122,7 @@ Embedding =
cb:
click: (e) ->
e.preventDefault()
if Conf['Floating Embeds'] or $.hasClass(doc, 'catalog-mode')
if not $.hasClass(@, 'embedded') and (Conf['Floating Embeds'] or $.hasClass(doc, 'catalog-mode'))
return if not (div = Embedding.media.firstChild)
$.replace div, Embedding.cb.embed @
Embedding.lastEmbed = Get.postFromNode(@).nodes.root