Commit 1e907498 authored by Sato Hiroyuki's avatar Sato Hiroyuki

The commit is marked and displayed in the center.

parent 7812cb77
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
branch_graph = new BranchGraph($("#holder"), { branch_graph = new BranchGraph($("#holder"), {
url: '#{project_graph_path(@project, @ref, format: :json)}', url: '#{project_graph_path(@project, @ref, format: :json)}',
commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}', commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}',
ref: '#{@ref}' ref: '#{@ref}',
commit_id: '#{@commit && @commit.id}'
}); });
}); });
...@@ -161,13 +161,22 @@ ...@@ -161,13 +161,22 @@
if (this.commits[i].refs) { if (this.commits[i].refs) {
this.appendLabel(x, y, this.commits[i].refs); this.appendLabel(x, y, this.commits[i].refs);
}
// The main branch is displayed in the center. // mark commit and displayed in the center
re = new RegExp('(^| )' + this.options.ref + '( |$)'); if (this.commits[i].id == this.options.commit_id) {
if (this.commits[i].refs.match(re)) { r.path([
'M', x, y - 5,
'L', x + 4, y - 15,
'L', x - 4, y - 15,
'Z'
]).attr({
"fill": "#000",
"fill-opacity": .7,
"stroke": "none"
});
scrollLeft = x - graphWidth / 2; scrollLeft = x - graphWidth / 2;
} }
}
this.appendAnchor(top, this.commits[i], x, y); this.appendAnchor(top, this.commits[i], x, y);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment