summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorSato Hiroyuki <sathiroyuki@gmail.com>2013-01-29 17:25:17 +0900
committerSato Hiroyuki <sathiroyuki@gmail.com>2013-01-30 09:12:03 +0900
commit525a8cd3e96b7bae0acda8b6e94df529fa06ff6a (patch)
treedbfda7c6ee03274470c2176c7c19dc396fc4ac5a /vendor
parentc84675ee06dfc72c46c178ef40e30f03053dcc5a (diff)
downloadgitlab-ce-525a8cd3e96b7bae0acda8b6e94df529fa06ff6a.tar.gz
Switchable the main branch on network graph
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 93849c79e80..cdaa8dd8d37 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;
@@ -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();
};