# HG changeset patch # User Alexander Plavin # Date 2013-09-06 09:30:58 # Node ID 5ba3cf17da9e5ccb89bb4f73582dbf26e0f75155 # Parent 4a8c5a51f7a10a0ad49145eeec57e75c17dc0bc1 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. diff --git a/mercurial/templates/static/mercurial.js b/mercurial/templates/static/mercurial.js --- a/mercurial/templates/static/mercurial.js +++ b/mercurial/templates/static/mercurial.js @@ -407,12 +407,14 @@ function ajaxScrollInit(urlFormat, } 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) {