]> git.wh0rd.org - tt-rss.git/commitdiff
cdm: don't try to load content which is already there
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 12 Nov 2010 23:17:04 +0000 (02:17 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 12 Nov 2010 23:17:04 +0000 (02:17 +0300)
viewfeed.js

index 99f6f3e4c1581063130b8f51155648782b7b41a2..b710896e09af2e5122d883aebcbb0c8ab4e244db 100644 (file)
@@ -2001,33 +2001,39 @@ function cdmExpandArticle(id) {
                elem = $("CICD-" + id);
 
                if (!Element.visible(elem)) {
-                       $("FUPDPIC-" + id).src = "images/indicator_tiny.gif";
-                       $("CWRAP-" + id).innerHTML = "<div class=\"insensitive\">" + 
-                               __("Loading, please wait...") + "</div>";
                        Element.show(elem);
                        Element.hide("CEXC-" + id);
 
-                       var query = "?op=rpc&subop=cdmGetArticle&id=" + param_escape(id);
+                       if ($("CWRAP-" + id).innerHTML == "") {
 
-                       //console.log(query);
-
-                       new Ajax.Request("backend.php", {
-                               parameters: query,
-                               onComplete: function(transport) { 
-                                       $("FUPDPIC-" + id).src = 'images/blank_icon.gif';
-
-                                       if (transport.responseXML) {
-                                               var article = transport.responseXML.getElementsByTagName("article")[0];
-                                               var recv_id = article.getAttribute("id");
-
-                                               if (recv_id == id)
-                                                       $("CWRAP-" + id).innerHTML = article.firstChild.nodeValue;
-
-                                       } else {
-                                               $("CWRAP-" + id).innerHTML = __("Unable to load article.");
+                               $("FUPDPIC-" + id).src = "images/indicator_tiny.gif";
 
-                                       }
-                       }});
+                               $("CWRAP-" + id).innerHTML = "<div class=\"insensitive\">" + 
+                                       __("Loading, please wait...") + "</div>";
+       
+                               var query = "?op=rpc&subop=cdmGetArticle&id=" + param_escape(id);
+       
+                               //console.log(query);
+       
+                               new Ajax.Request("backend.php", {
+                                       parameters: query,
+                                       onComplete: function(transport) { 
+                                               $("FUPDPIC-" + id).src = 'images/blank_icon.gif';
+       
+                                               if (transport.responseXML) {
+                                                       var article = transport.responseXML.getElementsByTagName("article")[0];
+                                                       var recv_id = article.getAttribute("id");
+       
+                                                       if (recv_id == id)
+                                                               $("CWRAP-" + id).innerHTML = article.firstChild.nodeValue;
+       
+                                               } else {
+                                                       $("CWRAP-" + id).innerHTML = __("Unable to load article.");
+       
+                                               }
+                               }});
+       
+                       }
                }
 
                var new_offset = $("RROW-" + id).offsetTop;