diff options
author | Phil Hughes <me@iamphill.com> | 2018-10-19 10:37:42 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-10-19 10:37:42 +0100 |
commit | 369bb6fb144d5ff6dca24e7e14ea795deea9bb86 (patch) | |
tree | 5e8509ff00a1040c5e01723d79fe5b81d5736e3b | |
parent | d76c647797ac7fe55f6f98b4acc1f8f061368e5e (diff) | |
download | gitlab-ce-369bb6fb144d5ff6dca24e7e14ea795deea9bb86.tar.gz |
Fixed merge request fill tree not respecting fluid width
This fixes a bug where the merge request fill tree
would not respect the users fluid width preference.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52916
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 2 | ||||
-rw-r--r-- | changelogs/unreleased/mr-file-tree-inline-fluid-width-fix.yml | 5 | ||||
-rw-r--r-- | spec/javascripts/merge_request_tabs_spec.js | 8 |
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 03f3bb42193..2950c2299ab 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -419,7 +419,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(); |