Switchable the main branch on network graph
This commit is contained in:
parent
c84675ee06
commit
525a8cd3e9
9 changed files with 43 additions and 22 deletions
11
vendor/assets/javascripts/branch-graph.js
vendored
11
vendor/assets/javascripts/branch-graph.js
vendored
|
@ -73,7 +73,8 @@
|
|||
, cumonth = ""
|
||||
, offsetX = 20
|
||||
, offsetY = 60
|
||||
, barWidth = Math.max(graphWidth, this.dayCount * 20 + 320);
|
||||
, barWidth = Math.max(graphWidth, this.dayCount * 20 + 320)
|
||||
, scrollLeft = cw;
|
||||
|
||||
this.raphael = r;
|
||||
|
||||
|
@ -145,12 +146,18 @@
|
|||
|
||||
if (this.commits[i].refs) {
|
||||
this.appendLabel(x, y, this.commits[i].refs);
|
||||
|
||||
// The main branch is displayed in the center.
|
||||
re = new RegExp('(^| )' + this.options.ref + '( |$)');
|
||||
if (this.commits[i].refs.match(re)) {
|
||||
scrollLeft = x - graphWidth / 2;
|
||||
}
|
||||
}
|
||||
|
||||
this.appendAnchor(top, this.commits[i], x, y);
|
||||
}
|
||||
top.toFront();
|
||||
this.element.scrollLeft(cw);
|
||||
this.element.scrollLeft(scrollLeft);
|
||||
this.bindEvents();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue