summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-10-19 11:07:17 +0000
committerThiago Presa <tpresa@gitlab.com>2018-10-31 23:54:03 -0300
commitf19ae85a0351c756e382ed9881900a9b5a0aa3b2 (patch)
treeb81a90eeaca2304d2a9882c136be5f3df59fb113
parentadea99b227a428dbda27e8fa2ed36c35672f5b07 (diff)
downloadgitlab-ce-f19ae85a0351c756e382ed9881900a9b5a0aa3b2.tar.gz
Merge branch 'mr-file-tree-inline-fluid-width-fix' into 'master'
Fixed merge request fill tree not respecting fluid width Closes #52916 See merge request gitlab-org/gitlab-ce!22487
-rw-r--r--app/assets/javascripts/merge_request_tabs.js2
-rw-r--r--changelogs/unreleased/mr-file-tree-inline-fluid-width-fix.yml5
-rw-r--r--spec/javascripts/merge_request_tabs_spec.js8
3 files changed, 14 insertions, 1 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index 78f56ab57ff..3e11b059b63 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -421,7 +421,7 @@ export default class MergeRequestTabs {
if (this.diffViewType() === 'parallel' || removeLimited) {
$wrapper.removeClass('container-limited');
} else {
- $wrapper.addClass('container-limited');
+ $wrapper.toggleClass('container-limited', this.fixedLayoutPref);
}
}
diff --git a/changelogs/unreleased/mr-file-tree-inline-fluid-width-fix.yml b/changelogs/unreleased/mr-file-tree-inline-fluid-width-fix.yml
new file mode 100644
index 00000000000..b61f47724fc
--- /dev/null
+++ b/changelogs/unreleased/mr-file-tree-inline-fluid-width-fix.yml
@@ -0,0 +1,5 @@
+---
+title: Fixed merge request fill tree toggling not respecting fluid width preference
+merge_request:
+author:
+type: fixed
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js
index 7251ce19a90..7714197c821 100644
--- a/spec/javascripts/merge_request_tabs_spec.js
+++ b/spec/javascripts/merge_request_tabs_spec.js
@@ -224,6 +224,14 @@ describe('MergeRequestTabs', function() {
expect($('.content-wrapper')).not.toContainElement('.container-limited');
});
+ it('does not add container-limited when fluid layout is prefered', function() {
+ $('.content-wrapper .container-fluid').removeClass('container-limited');
+
+ this.class.expandViewContainer(false);
+
+ expect($('.content-wrapper')).not.toContainElement('.container-limited');
+ });
+
it('does remove container-limited from breadcrumbs', function() {
$('.container-limited').addClass('breadcrumbs');
this.class.expandViewContainer();