summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-03 12:29:15 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-03 12:29:15 +0000
commit0ef6c949d1b6d457526686a2bf713bcc06ec4e02 (patch)
treece96120954a71630f2c312968697f066c20711b5 /public
parent8e2482d2c195c461751302e552aa4ebd76c6d85a (diff)
downloadredmine-0ef6c949d1b6d457526686a2bf713bcc06ec4e02.tar.gz
redmine-0ef6c949d1b6d457526686a2bf713bcc06ec4e02.zip
Revision Graph and Table should work with vertical-align: middle (#22278).
Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@15299 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/revision_graph.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/public/javascripts/revision_graph.js b/public/javascripts/revision_graph.js
index fee2b8488..403d591c8 100644
--- a/public/javascripts/revision_graph.js
+++ b/public/javascripts/revision_graph.js
@@ -24,6 +24,18 @@ function drawRevisionGraph(holder, commits_hash, graph_space) {
graph_right_side = graph_x_offset + (graph_space + 1) * XSTEP,
graph_bottom = commit_table_rows.last().position().top + commit_table_rows.last().height() - graph_y_offset;
+
+ var yForRow = function (index, commit) {
+ var row = commit_table_rows.eq(index);
+
+ switch (row.find("td:first").css("vertical-align")) {
+ case "middle":
+ return row.position().top + (row.height() / 2) - graph_y_offset;
+ default:
+ return row.position().top + - graph_y_offset + CIRCLE_INROW_OFFSET;
+ }
+ };
+
revisionGraph.setSize(graph_right_side, graph_bottom);
// init colors
@@ -41,7 +53,7 @@ function drawRevisionGraph(holder, commits_hash, graph_space) {
if (!commit.hasOwnProperty("space"))
commit.space = 0;
- y = commit_table_rows.eq(max_rdmid - commit.rdmid).position().top - graph_y_offset + CIRCLE_INROW_OFFSET;
+ y = yForRow(max_rdmid - commit.rdmid);
x = graph_x_offset + XSTEP / 2 + XSTEP * commit.space;
revisionGraph.circle(x, y, 3)
.attr({
@@ -55,7 +67,7 @@ function drawRevisionGraph(holder, commits_hash, graph_space) {
if (!parent_commit.hasOwnProperty("space"))
parent_commit.space = 0;
- parent_y = commit_table_rows.eq(max_rdmid - parent_commit.rdmid).position().top - graph_y_offset + CIRCLE_INROW_OFFSET;
+ parent_y = yForRow(max_rdmid - parent_commit.rdmid);
parent_x = graph_x_offset + XSTEP / 2 + XSTEP * parent_commit.space;
if (parent_commit.space == commit.space) {
// vertical path