Switchable the main branch on network graph

This commit is contained in:
Sato Hiroyuki 2013-01-29 17:25:17 +09:00
parent c84675ee06
commit 525a8cd3e9
9 changed files with 43 additions and 22 deletions

View file

@ -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();
};