]> git.wh0rd.org Git - tt-rss.git/commitdiff
experimental: limit initialized html content for expanded cdm
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 21 Mar 2013 06:34:36 +0000 (10:34 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 21 Mar 2013 06:34:39 +0000 (10:34 +0400)
classes/feeds.php
js/viewfeed.js

index caf22322c50dbced0812be2def86a0f082b2ef38..79aaa8e55dff0cc8c029375b28aec1b376f6c9b6 100644 (file)
@@ -624,14 +624,14 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<span id=\"CWRAP-$id\">";
 
-                                       if (!$expand_cdm) {
-                                               $reply['content'] .= "<span id=\"CENCW-$id\">";
+//                                     if (!$expand_cdm) {
+                                               $reply['content'] .= "<span id=\"CENCW-$id\" style=\"display : none\">";
                                                $reply['content'] .= htmlspecialchars($line["content"]);
                                                $reply['content'] .= "</span.";
 
-                                       } else {
-                                               $reply['content'] .= $line["content"];
-                                       }
+//                                     } else {
+//                                             $reply['content'] .= $line["content"];
+//                                     }
 
                                        $reply['content'] .= "</span>";
 
index eee8df772ae54244ad907f6063162584bf77f132..5567c717a6144ed45cdfeb93c43f4ec0332a8a2b 100644 (file)
@@ -205,6 +205,8 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
 
                _infscroll_request_sent = 0;
 
+               headlines_scroll_handler($("headlines-frame"));
+
                notify("");
 
        } catch (e) {
@@ -1176,6 +1178,23 @@ function headlines_scroll_handler(e) {
        try {
                var hsp = $("headlines-spacer");
 
+               $$("#headlines-frame > div[id*=RROW]").each(
+                       function(child) {
+                               if (child.offsetTop <= $("headlines-frame").scrollTop +
+                                       $("headlines-frame").offsetHeight) {
+
+                                       var cencw = $("CENCW-" + child.id.replace("RROW-", ""));
+
+                                       if (cencw) {
+                                               cencw.innerHTML = htmlspecialchars_decode(cencw.innerHTML);
+                                               cencw.setAttribute('id', '');
+                                               Element.show(cencw);
+                                       }
+                               }
+                       }
+               );
+
+
                if (!_infscroll_disable) {
                        if ((hsp && e.scrollTop + e.offsetHeight >= hsp.offsetTop - hsp.offsetHeight) ||
                                        (e.scrollHeight != 0 &&
@@ -1197,7 +1216,7 @@ function headlines_scroll_handler(e) {
 
                        $$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
                                function(child) {
-                                       if ($("headlines-frame").scrollTop >
+                                       if (child.hasClassName("Unread") && $("headlines-frame").scrollTop >
                                                        (child.offsetTop + child.offsetHeight/2)) {
 
                                                var id = child.id.replace("RROW-", "");
@@ -1388,6 +1407,7 @@ function cdmExpandArticle(id) {
                        if (cencw) {
                                cencw.innerHTML = htmlspecialchars_decode(cencw.innerHTML);
                                cencw.setAttribute('id', '');
+                               Element.show(cencw);
                        }
 
                        Element.show(elem);