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

login
register
mail settings
Submitter Yuya Nishihara
Date May 6, 2015, 11:27 p.m.
Message ID <395f380c5f36e3843fe2.1430954852@mimosa>
Download mbox | patch
Permalink /patch/8934/
State Accepted
Headers show

Comments

Yuya Nishihara - May 6, 2015, 11:27 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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
Matt Mackall - May 7, 2015, 6:51 p.m.
On Thu, 2015-05-07 at 08:27 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@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

Queued for stable, thanks.

Patch

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>'