digest: only try to show feed loading indicator when feed is actually present on screen

This commit is contained in:
Andrew Dolgov 2010-09-22 14:10:39 +04:00
parent e638cd0201
commit b8a1b2ae94

View file

@ -253,11 +253,13 @@ function viewfeed(feed_id, offset, replace, no_effects, no_indicator, callback)
console.log(query);
var img = $("F-" + feed_id).getElementsByTagName("IMG")[0];
if ($("F-" + feed_id)) {
var img = $("F-" + feed_id).getElementsByTagName("IMG")[0];
if (img && !no_indicator) {
img.setAttribute("orig_src", img.src);
img.src = 'images/indicator_tiny.gif';
if (img && !no_indicator) {
img.setAttribute("orig_src", img.src);
img.src = 'images/indicator_tiny.gif';
}
}
new Ajax.Request("backend.php", {