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");
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;
}
}
}
+// 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 {
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);
var f_document = window.frames["feeds-frame"].document;
- parse_counters(reply, f_document);
+ parse_counters(reply, f_document, window);
updateTitle("");
notify("All feeds updated.");