From: Etienne Massip Date: Sat, 10 Mar 2012 13:41:09 +0000 (+0000) Subject: Moved head refs to node titles. X-Git-Tag: 1.4.0~179 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=24bd39d8ed52da07933b2c5954ef00d93aa3ef3f;p=redmine.git Moved head refs to node titles. Refs shoud not be displayed in the graph because they'll be necessarily truncated. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9169 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/public/javascripts/revision_graph.js b/public/javascripts/revision_graph.js index b4e03a48a..e3cd0dff0 100644 --- a/public/javascripts/revision_graph.js +++ b/public/javascripts/revision_graph.js @@ -44,24 +44,11 @@ function drawRevisionGraph(holder, commits_hash, graph_space) { y = commit_table_rows[max_rdmid - commit.rdmid].getLayout().get('top') - graph_y_offset + CIRCLE_INROW_OFFSET; x = graph_x_offset + XSTEP / 2 + XSTEP * commit.space; - revisionGraph.circle(x, y, 3).attr({fill: colors[commit.space], stroke: 'none'}); - - // title - if (commit.refs != null && commit.refs != '') { - longrefs = commit.refs; - shortrefs = longrefs.length > 15 ? longrefs.substr(0, 13) + '...' : longrefs; - - label = revisionGraph.text(x + 5, y + 5, shortrefs) - .attr({ - font: '12px Fontin-Sans, Arial', - fill: '#666', - title: longrefs, - cursor: 'pointer', - rotation: '0'}); - - labelBBox = label.getBBox(); - label.translate(labelBBox.width / 2, -labelBBox.height / 3); - } + revisionGraph.circle(x, y, 3) + .attr({ + fill: colors[commit.space], + stroke: 'none', + }).toFront(); // paths to parents commit.parent_scmids.each(function(parent_scmid) { @@ -89,16 +76,25 @@ function drawRevisionGraph(holder, commits_hash, graph_space) { 'M', x, y, 'V', graph_bottom]); } - path.attr({stroke: colors[commit.space], "stroke-width": 1.5}); + path.attr({stroke: colors[commit.space], "stroke-width": 1.5}).toBack(); }); - top.push(revisionGraph.circle(x, y, 10) + revision_dot_overlay = revisionGraph.circle(x, y, 10); + revision_dot_overlay .attr({ - fill: '#000', + fill: '#000', opacity: 0, - cursor: 'pointer', - href: commit.href}) - .hover(function () {}, function () {})); + cursor: 'pointer', + href: commit.href + }); + + if(commit.refs != null && commit.refs.length > 0) { + title = document.createElementNS(revisionGraph.canvas.namespaceURI, 'title'); + title.appendChild(document.createTextNode(commit.refs)); + revision_dot_overlay.node.appendChild(title); + } + + top.push(revision_dot_overlay); }); top.toFront();