summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Vorbach <paul@vorba.ch>2018-04-28 22:49:31 +0200
committerPaul Vorbach <paul@vorba.ch>2018-05-15 21:27:03 +0200
commit6a20cf91229bed0935b77a7a1886c80c78e5e7a2 (patch)
tree656ded17f37a04122df5d8b00e4b2193414025cd
parent728441a4080332d567a881d9ad833c211d6ab643 (diff)
downloadgitlab-ce-6a20cf91229bed0935b77a7a1886c80c78e5e7a2.tar.gz
Fix width of contributors graphs
The contributors graphs were sized with the full .content width in mind, but at some point GitLab changed to a more narrow design, so graphs would be too wide for their container divs. This change resizes contributors graphs relative to their correct container widths.
-rw-r--r--app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js b/app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js
index a99ce0f1c36..d7f4cae971b 100644
--- a/app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js
+++ b/app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js
@@ -109,7 +109,7 @@ export const ContributorsMasterGraph = (function(superClass) {
this.data = data1;
this.update_content = this.update_content.bind(this);
- this.width = $('.content').width() - parentPadding - (this.MARGIN.left + this.MARGIN.right);
+ this.width = $('.stat-graph').width() - parentPadding - (this.MARGIN.left + this.MARGIN.right);
this.height = 200;
this.x = null;
this.y = null;
@@ -218,12 +218,15 @@ export const ContributorsAuthorGraph = (function(superClass) {
extend(ContributorsAuthorGraph, superClass);
function ContributorsAuthorGraph(data1) {
+ const $parentElements = $('.person');
+ const parentPadding = parseFloat($parentElements.css('padding-left')) + parseFloat($parentElements.css('padding-right'));
+
this.data = data1;
// Don't split graph size in half for mobile devices.
if ($(window).width() < 768) {
- this.width = $('.content').width() - 80;
+ this.width = $('.stat-graph').width() - parentPadding - (this.MARGIN.left + this.MARGIN.right);
} else {
- this.width = ($('.content').width() / 2) - 100;
+ this.width = ($('.stat-graph').width() / 2) - parentPadding - (this.MARGIN.left + this.MARGIN.right);
}
this.height = 200;
this.x = null;