]> git.wh0rd.org Git - tt-rss.git/commitdiff
js: add get_feed_unread()
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 22 Nov 2007 05:05:24 +0000 (06:05 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 22 Nov 2007 05:05:24 +0000 (06:05 +0100)
feedlist.js
functions.js

index 272a6c15ef36432d31a7f037e795bad5d2b383b0..8bbc24626ff533101f238b3495d4d9c74a8386de 100644 (file)
@@ -149,11 +149,10 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
                                queue: { position:'end', scope: 'FEEDL-' + feed, limit: 1 } } );
                }
 
-               var unread_ctr = document.getElementById("FEEDU-" + feed);
+               var unread_ctr = get_feed_unread(feed);
                var cache_check = false;
 
-               if (unread_ctr && !page_offset && !force_nocache && !subop) {
-                       unread_ctr = unread_ctr.innerHTML;
+               if (unread_ctr != -1 && !page_offset && !force_nocache && !subop) {
 
                        var cache_prefix = "";
                                
index b093398a667be930bd8e2105154d84a8037c6b50..93c080dbc21f7cd8758a18ee51ad6b9e3dfc2e75 100644 (file)
@@ -778,6 +778,15 @@ function all_counters_callback2(transport) {
        }
 }
 
+function get_feed_unread(id) {
+       try {
+               return parseInt(document.getElementById("FEEDU-" + id).innerHTML);      
+       } catch (e) {
+               exception_error("get_feed_unread", e, true);
+               return -1;
+       }
+}
+
 function get_feed_entry_unread(doc, elem) {
 
        var id = elem.id.replace("FEEDR-", "");