From b8a1b2ae945d4295971c72aad53fcf5841eb76c7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 22 Sep 2010 14:10:39 +0400 Subject: [PATCH] digest: only try to show feed loading indicator when feed is actually present on screen --- digest.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/digest.js b/digest.js index cb42633b..3fe85f68 100644 --- a/digest.js +++ b/digest.js @@ -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", { -- 2.39.5