]> git.wh0rd.org Git - tt-rss.git/commitdiff
auto refresh active feed when new messages are detected
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 4 Mar 2006 17:29:37 +0000 (18:29 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 4 Mar 2006 17:29:37 +0000 (18:29 +0100)
functions.js
tt-rss.js

index ac9b55bf351e88695248d69a8339e8d126eb5b28..db8f695ff82076efcbe92bbf0f8002fbd80eb828 100644 (file)
@@ -358,7 +358,7 @@ if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') {
        xmlhttp_rpc = new XMLHttpRequest();
 }
 
-function parse_counters(reply, f_document, title_obj) {
+function parse_counters(reply, f_document, title_obj, scheduled_call) {
        try {
                for (var l = 0; l < reply.childNodes.length; l++) {
                        if (!reply.childNodes[l] ||
@@ -393,6 +393,11 @@ function parse_counters(reply, f_document, title_obj) {
                        var feed_img = f_document.getElementById("FIMG-" + id);
 
                        if (feedctr && feedu && feedr) {
+
+                               if (feedu.innerHTML != ctr && id == getActiveFeedId() && scheduled_call) {
+                                       var hf = title_obj.parent.frames["headlines-frame"];
+                                       hf.location.reload(true);
+                               }
                
                                feedu.innerHTML = ctr;
 
index 942ea58085c130511dd57e1d4175b40a1de11f84..7648b8e1876694bd469fec512addb5b87fb0cb3a 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -128,7 +128,7 @@ function refetch_callback() {
        
                        var f_document = window.frames["feeds-frame"].document;
 
-                       parse_counters(reply, f_document, window);
+                       parse_counters(reply, f_document, window, true);
 
                        debug("refetch_callback: done");