]> git.wh0rd.org Git - tt-rss.git/commitdiff
pass object to call updateTitle() to parse_counters() (closes #9)
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 21 Dec 2005 07:12:17 +0000 (08:12 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 21 Dec 2005 07:12:17 +0000 (08:12 +0100)
functions.js
tt-rss.js

index 989a144bdec77db7db10946087e57470da5d2cde..01f1a144879198a899217f928b9db7c6b4970b1f 100644 (file)
@@ -355,7 +355,7 @@ if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') {
        xmlhttp_rpc = new XMLHttpRequest();
 }
 
-function parse_counters(reply, f_document) {
+function parse_counters(reply, f_document, title_obj) {
        try {
                for (var l = 0; l < reply.childNodes.length; l++) {
                        var id = reply.childNodes[l].getAttribute("id");
@@ -365,8 +365,8 @@ function parse_counters(reply, f_document) {
                        var has_img = reply.childNodes[l].getAttribute("hi");
        
                        if (id == "global-unread") {
-                               parent.global_unread = ctr;
-                               parent.updateTitle();
+                               title_obj.global_unread = ctr;
+                               title_obj.updateTitle();
                                continue;
                        }
        
@@ -419,6 +419,9 @@ function parse_counters(reply, f_document) {
        }
 }
 
+// this one is called from feedlist context
+// thus title_obj passed to parse_counters is parent (e.g. main ttrss window)
+
 function all_counters_callback() {
        if (xmlhttp_rpc.readyState == 4) {
                try {
@@ -430,7 +433,7 @@ function all_counters_callback() {
                        var reply = xmlhttp_rpc.responseXML.firstChild;
                        var f_document = parent.frames["feeds-frame"].document;
 
-                       parse_counters(reply, f_document);
+                       parse_counters(reply, f_document, parent);
        
                } catch (e) {
                        exception_error("all_counters_callback", e);
index 638f066de3813a6e077defc4cbff3da7fabd4b93..c66d57ce7afa4439647ad3b6027c4c2f1b65ffcb 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -96,7 +96,7 @@ function refetch_callback() {
        
                        var f_document = window.frames["feeds-frame"].document;
 
-                       parse_counters(reply, f_document);
+                       parse_counters(reply, f_document, window);
        
                        updateTitle("");
                        notify("All feeds updated.");