hgweb: add parentSelector argument to process_dates
authorAlexander Plavin <alexander@plav.in>
Fri, 06 Sep 2013 13:30:58 +0400
changeset 19858 4a8c5a51f7a1
parent 19857 14fddba036f8
child 19859 5ba3cf17da9e
hgweb: add parentSelector argument to process_dates Allow specifying parent selector of elements to process, useful for incremental page updates.
mercurial/templates/static/mercurial.js
--- 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
@@ -176,7 +176,7 @@
 }
 
 
-function process_dates(){
+function process_dates(parentSelector){
 
 	// derived from code from mercurial/templatefilter.py
 
@@ -253,7 +253,7 @@
 		}
 	}
 
-	var nodes = document.querySelectorAll('.age');
+	var nodes = document.querySelectorAll((parentSelector || '') + ' .age');
 	var dateclass = new RegExp('\\bdate\\b');
 	for (var i=0; i<nodes.length; ++i){
 		var node = nodes[i];