changeset 19859:5ba3cf17da9e

hgweb: call process_dates with a specified selector in ajax scroll Now this function processes only newly added entries, and not old ones, the amount of which can be much bigger.
author Alexander Plavin <alexander@plav.in>
date Fri, 06 Sep 2013 13:30:58 +0400
parents 4a8c5a51f7a1
children 6cd9b8428104
files mercurial/templates/static/mercurial.js
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/static/mercurial.js	Fri Sep 06 13:30:58 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Fri Sep 06 13:30:58 2013 +0400
@@ -407,12 +407,14 @@
                     } else {
                         var doc = docFromHTML(htmlText);
                         var nodes = doc.querySelector(containerSelector).children;
+                        var curClass = 'c' + Date.now();
                         while (nodes.length) {
                             var node = nodes[0];
                             node = document.adoptNode(node);
+                            node.classList.add(curClass);
                             container.appendChild(node);
                         }
-                        process_dates();
+                        process_dates('.' + curClass);
                     }
                 },
                 function onerror(errorText) {