fix "embed original" plugin
This commit is contained in:
parent
2714d5caa3
commit
44db06b6be
1 changed files with 8 additions and 9 deletions
|
@ -19,11 +19,11 @@ function embedOriginalArticle(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c) {
|
if (c) {
|
||||||
var iframe = c.getElementsByClassName("embeddedContent")[0];
|
var iframe = c.parentNode.getElementsByClassName("embeddedContent")[0];
|
||||||
|
|
||||||
if (iframe) {
|
if (iframe) {
|
||||||
Element.show(c.firstChild);
|
Element.show(c);
|
||||||
c.removeChild(iframe);
|
c.parentNode.removeChild(iframe);
|
||||||
|
|
||||||
if (isCdmMode()) {
|
if (isCdmMode()) {
|
||||||
cdmScrollToArticleId(id, true);
|
cdmScrollToArticleId(id, true);
|
||||||
|
@ -43,16 +43,15 @@ function embedOriginalArticle(id) {
|
||||||
var iframe = new Element("iframe", {
|
var iframe = new Element("iframe", {
|
||||||
class: "embeddedContent",
|
class: "embeddedContent",
|
||||||
src: ti.url,
|
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',
|
sandbox: 'allow-scripts',
|
||||||
});
|
});
|
||||||
|
|
||||||
if (c) {
|
if (c) {
|
||||||
Element.hide(c.firstChild);
|
Element.hide(c);
|
||||||
|
c.parentNode.insertBefore(iframe,c);
|
||||||
if (c.firstChild.nextSibling)
|
|
||||||
c.insertBefore(iframe, c.firstChild.nextSibling);
|
|
||||||
else
|
|
||||||
c.appendChild(iframe);
|
|
||||||
|
|
||||||
if (isCdmMode()) {
|
if (isCdmMode()) {
|
||||||
cdmScrollToArticleId(id, true);
|
cdmScrollToArticleId(id, true);
|
||||||
|
|
Loading…
Reference in a new issue