[PATCH STABLE] hgweb: bring back infinite scroll in shortlog of paper style

Yuya Nishihara yuya at tcha.org
Wed May 6 23:27:32 UTC 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1430952399 -32400
#      Thu May 07 07:46:39 2015 +0900
# Branch stable
# Node ID 395f380c5f36e3843fe2fa9742f04921b2cb94de
# Parent  5bc506ee87d261269f4c173f607f0e08efce2fab
hgweb: bring back infinite scroll in shortlog of paper style

Since fdf7794be41d, column headers are wrapped by <thead> element, so the first
and only <tbody> contains changelog data. I got the following error without
this patch:

    Uncaught TypeError: Cannot read property 'lastElementChild' of null
      scrollHandler @ mercurial.js:375

diff --git a/mercurial/templates/paper/shortlog.tmpl b/mercurial/templates/paper/shortlog.tmpl
--- a/mercurial/templates/paper/shortlog.tmpl
+++ b/mercurial/templates/paper/shortlog.tmpl
@@ -80,7 +80,7 @@
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
-            '.bigtable > tbody:nth-of-type(2)',
+            '.bigtable > tbody',
             '<tr class="%class%">\\
             <td colspan="3" style="text-align: center;">%text%</td>\\
             </tr>'
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -797,7 +797,7 @@ Logs and changes
                   var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                   return m ? m[1] : null;
               },
-              '.bigtable > tbody:nth-of-type(2)',
+              '.bigtable > tbody',
               '<tr class="%class%">\
               <td colspan="3" style="text-align: center;">%text%</td>\
               </tr>'
diff --git a/tests/test-hgweb-empty.t b/tests/test-hgweb-empty.t
--- a/tests/test-hgweb-empty.t
+++ b/tests/test-hgweb-empty.t
@@ -99,7 +99,7 @@ Some tests for hgweb in an empty reposit
                   var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                   return m ? m[1] : null;
               },
-              '.bigtable > tbody:nth-of-type(2)',
+              '.bigtable > tbody',
               '<tr class="%class%">\
               <td colspan="3" style="text-align: center;">%text%</td>\
               </tr>'
@@ -210,7 +210,7 @@ Some tests for hgweb in an empty reposit
                   var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                   return m ? m[1] : null;
               },
-              '.bigtable > tbody:nth-of-type(2)',
+              '.bigtable > tbody',
               '<tr class="%class%">\
               <td colspan="3" style="text-align: center;">%text%</td>\
               </tr>'


More information about the Mercurial-devel mailing list