Commit 784aa266bdd38ec560c11bea92fc9b815e2ca456
1 parent
2f7f46b2
Exists in
master
and in
4 other branches
Refactor: grouping parent and their space by including array.
Showing
3 changed files
with
7 additions
and
5 deletions
Show diff stats
app/assets/javascripts/branch-graph.js
... | ... | @@ -117,7 +117,7 @@ |
117 | 117 | // Draw lines |
118 | 118 | for (var j = 0, jj = this.commits[i].parents.length; j < jj; j++) { |
119 | 119 | c = this.preparedCommits[this.commits[i].parents[j][0]]; |
120 | - ps = this.commits[i].parent_spaces[j]; | |
120 | + ps = this.commits[i].parents[j][1]; | |
121 | 121 | if (c) { |
122 | 122 | var cx = offsetX + 20 * c.time |
123 | 123 | , cy = offsetY + 10 * c.space | ... | ... |
app/helpers/graph_helper.rb
app/views/graph/show.json.erb
... | ... | @@ -5,9 +5,7 @@ |
5 | 5 | days: @graph.days.compact.map { |d| [d.day, d.strftime("%b")] }, |
6 | 6 | commits: @graph.commits.map do |c| |
7 | 7 | { |
8 | - parents: c.parents.collect do |p| | |
9 | - [p.id,0,0] | |
10 | - end, | |
8 | + parents: parents_zip_spaces(c.parents, c.parent_spaces), | |
11 | 9 | author: { |
12 | 10 | name: c.author.name, |
13 | 11 | email: c.author.email, |
... | ... | @@ -15,7 +13,6 @@ |
15 | 13 | }, |
16 | 14 | time: c.time, |
17 | 15 | space: c.spaces.first, |
18 | - parent_spaces: c.parent_spaces, | |
19 | 16 | refs: join_with_space(c.refs), |
20 | 17 | id: c.sha, |
21 | 18 | date: c.date, | ... | ... |