summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rw-r--r--vendor/assets/javascripts/branch-graph.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/vendor/assets/javascripts/branch-graph.js b/vendor/assets/javascripts/branch-graph.js
index 76494196e43..69bddd78d63 100644
--- a/vendor/assets/javascripts/branch-graph.js
+++ b/vendor/assets/javascripts/branch-graph.js
@@ -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;
@@ -160,12 +161,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();
};