diff options
author | Andrew Dolgov <[email protected]> | 2013-04-05 00:55:35 -0700 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-05 00:55:35 -0700 |
commit | 8edcbed6b753639b6366b11200d26cba0c52c862 (patch) | |
tree | 21c11a067efa24ee6496244581045b789c7d2187 /plugins | |
parent | 2714d5caa3e715b25cd75ec67ebe79973dfda2a2 (diff) | |
parent | 44db06b6be95f481d83951a2b1bc1f0a9063a465 (diff) |
Merge pull request #130 from seidler2547/master
fix "embed original"
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/embed_original/init.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/embed_original/init.js b/plugins/embed_original/init.js index 517f2cd54..17090653d 100644 --- a/plugins/embed_original/init.js +++ b/plugins/embed_original/init.js @@ -19,11 +19,11 @@ function embedOriginalArticle(id) { } if (c) { - var iframe = c.getElementsByClassName("embeddedContent")[0]; + var iframe = c.parentNode.getElementsByClassName("embeddedContent")[0]; if (iframe) { - Element.show(c.firstChild); - c.removeChild(iframe); + Element.show(c); + c.parentNode.removeChild(iframe); if (isCdmMode()) { cdmScrollToArticleId(id, true); @@ -43,16 +43,15 @@ function embedOriginalArticle(id) { var iframe = new Element("iframe", { class: "embeddedContent", src: ti.url, + width: (c.parentNode.offsetWidth-5)+'px', + height: (c.parentNode.parentNode.offsetHeight-c.parentNode.firstChild.offsetHeight-5)+'px', + style: "overflow: auto; border: none; min-height: "+(document.body.clientHeight/2)+"px;", sandbox: 'allow-scripts', }); if (c) { - Element.hide(c.firstChild); - - if (c.firstChild.nextSibling) - c.insertBefore(iframe, c.firstChild.nextSibling); - else - c.appendChild(iframe); + Element.hide(c); + c.parentNode.insertBefore(iframe,c); if (isCdmMode()) { cdmScrollToArticleId(id, true); |