From ee022ce8ea17ee0534beac5b8a58e4b845e85be9 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Tue, 20 Jan 2015 15:32:34 -0700 Subject: [PATCH] Fix #826 Conflicts: builds/appchan-x.user.js builds/crx/script.js --- src/Linkification/Embedding.coffee | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index 16c4dca99..1549f4d05 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -117,26 +117,25 @@ Embedding = $.rmClass Embedding.dialog, 'empty' return if $.hasClass @, "embedded" - $.rm @previousElementSibling unless $.hasClass @previousElementSibling, 'linkify' - @previousElementSibling.hidden = false + $.rm @nextElementSibling @textContent = '(embed)' else - @previousElementSibling.hidden = true - $.before @, Embedding.cb.embed @ + $.after @, Embedding.cb.embed @ @textContent = '(unembed)' $.toggleClass @, 'embedded' embed: (a) -> # We create an element to embed - el = (type = Embedding.types[a.dataset.key]).el a + container = $.el 'div' + $.add container, el = (type = Embedding.types[a.dataset.key]).el a # Set style values. el.style.cssText = if type.style? type.style else - "border: 0; width: 640px; height: 390px" + "border:0;width:640px;height:390px" - return el + return container title: (req, data) -> {key, uid, options, link, post} = data