Mercurial > kallithea
changeset 6626:5258b66bf5d7
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.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sat, 13 May 2017 02:29:13 +0200 |
parents | 05d09cec7b26 |
children | a166954bf84c |
files | kallithea/public/js/graph.js kallithea/templates/pullrequests/pullrequest_show.html |
diffstat | 2 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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 </td> - <td colspan="4">${_("Current revision - no change")}</td> + <td colspan="4"><span>${_("Current revision - no change")}</span></td> %else: <td> %if editable and cs.revision in c.avail_revs: