]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix "embed original" plugin
authorStefan Seidel <android@stefanseidel.info>
Fri, 5 Apr 2013 07:28:32 +0000 (09:28 +0200)
committerStefan Seidel <android@stefanseidel.info>
Fri, 5 Apr 2013 07:28:32 +0000 (09:28 +0200)
plugins/embed_original/init.js

index 517f2cd54a3c0c39346ebe16bcd42785a566aaa5..17090653d48722988a92f63e9cadbb337598abae 100644 (file)
@@ -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);