Commit 40567f29 authored by Phil Hughes's avatar Phil Hughes Committed by Denys Mishunov

Adds container around merge request header

As a follow-up to making the diffs be fluid layout by default
this makes the header (including the tabs) always keep the users
preferred layout mode.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/343042
parent 805a2f03
...@@ -392,8 +392,6 @@ export default { ...@@ -392,8 +392,6 @@ export default {
diffsApp.instrument(); diffsApp.instrument();
}, },
created() { created() {
this.mergeRequestContainers = document.querySelectorAll('.merge-request-container');
this.adjustView(); this.adjustView();
this.subscribeToEvents(); this.subscribeToEvents();
...@@ -521,13 +519,6 @@ export default { ...@@ -521,13 +519,6 @@ export default {
} else { } else {
this.removeEventListeners(); this.removeEventListeners();
} }
if (!this.isFluidLayout && this.glFeatures.mrChangesFluidLayout) {
this.mergeRequestContainers.forEach((el) => {
el.classList.toggle('limit-container-width', !this.shouldShow);
el.classList.toggle('container-limited', !this.shouldShow);
});
}
}, },
setEventListeners() { setEventListeners() {
Mousetrap.bind(keysFor(MR_PREVIOUS_FILE_IN_DIFF), () => this.jumpToFile(-1)); Mousetrap.bind(keysFor(MR_PREVIOUS_FILE_IN_DIFF), () => this.jumpToFile(-1));
......
...@@ -702,23 +702,4 @@ describe('diffs/components/app', () => { ...@@ -702,23 +702,4 @@ describe('diffs/components/app', () => {
); );
}); });
}); });
describe('fluid layout', () => {
beforeEach(() => {
setFixtures(
'<div><div class="merge-request-container limit-container-width container-limited"></div></div>',
);
});
it('removes limited container classes when on diffs tab', () => {
createComponent({ isFluidLayout: false, shouldShow: true }, () => {}, {
glFeatures: { mrChangesFluidLayout: true },
});
const containerClassList = document.querySelector('.merge-request-container').classList;
expect(containerClassList).not.toContain('container-limited');
expect(containerClassList).not.toContain('limit-container-width');
});
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment