Changeset - 5258b66bf5d7
[Not reviewed]
default
0 2 0
Mads Kiilerich - 9 years ago 2017-05-13 02:29:13
mads@kiilerich.com
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.
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/graph.js
Show inline comments
 
@@ -112,8 +112,9 @@ function BranchRenderer(canvas_id, conte
 
			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);
 

	
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -165,7 +165,7 @@ ${self.repo_context_bar('showpullrequest
 
                            ${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:
0 comments (0 inline, 0 general)