# HG changeset patch # User Mads Kiilerich # Date 1494635353 -7200 # Node ID 5258b66bf5d775fd8b1ec6ee156b004c9b988dca # Parent 05d09cec7b2685903f497bc425e28c83270539eb pullrequests: fix "additional changes" js error - make sure all cs tables have a first column to align with (Issue #274) A slight simplification of 16234f629cfb and fixing a JavaScript failure for unauthenticated visits to PRs with pending available changesets. nextFirstincell would be undefined becuase the "Current revision - no change" line didn't have any elements in td, and nextFirstincell.offsetTop would thus fail. Fixed by adding a span around the text. Also clarify that any element is fine - there is no need to check for visibility. diff -r 05d09cec7b26 -r 5258b66bf5d7 kallithea/public/js/graph.js --- a/kallithea/public/js/graph.js Wed May 10 18:38:52 2017 +0200 +++ b/kallithea/public/js/graph.js Sat May 13 02:29:13 2017 +0200 @@ -112,8 +112,9 @@ extinct_node = cur[6]; unstable_node = cur[7]; - var firstincell = $(row).find('td>:visible')[0]; - var nextFirstincell = $(next).find('td>:visible')[0]; + // center dots on the first element in a td (not necessarily the first one, but there must be one) + var firstincell = $(row).find('td>*')[0]; + var nextFirstincell = $(next).find('td>*')[0]; var rowY = Math.floor(row.offsetTop + firstincell.offsetTop + firstincell.offsetHeight/2); var nextY = Math.floor((next == null) ? rowY + row.offsetHeight/2 : next.offsetTop + nextFirstincell.offsetTop + nextFirstincell.offsetHeight/2); diff -r 05d09cec7b26 -r 5258b66bf5d7 kallithea/templates/pullrequests/pullrequest_show.html --- a/kallithea/templates/pullrequests/pullrequest_show.html Wed May 10 18:38:52 2017 +0200 +++ b/kallithea/templates/pullrequests/pullrequest_show.html Sat May 13 02:29:13 2017 +0200 @@ -165,7 +165,7 @@ ${h.radio(name='updaterev', value='', checked=True)} %endif - ${_("Current revision - no change")} + ${_("Current revision - no change")} %else: %if editable and cs.revision in c.avail_revs: