Unverified Commit 4fa1f7b8 authored by Clement Ho's avatar Clement Ho Committed by Steve Azzopardi

Merge branch '52532-unable-to-toggle-issuable-sidebar-out-of-collapsed-state' into 'master'

Allow Issue and Merge Request sidebar to be toggled from collapsed state

Closes #52532

See merge request gitlab-org/gitlab-ce!22353
parent 57666446
...@@ -202,7 +202,6 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -202,7 +202,6 @@ document.addEventListener('DOMContentLoaded', () => {
$('.navbar-toggler').on('click', () => { $('.navbar-toggler').on('click', () => {
$('.header-content').toggleClass('menu-expanded'); $('.header-content').toggleClass('menu-expanded');
gl.lazyLoader.loadCheck();
}); });
// Show/hide comments on diff // Show/hide comments on diff
......
...@@ -57,8 +57,6 @@ Sidebar.prototype.sidebarToggleClicked = function (e, triggered) { ...@@ -57,8 +57,6 @@ Sidebar.prototype.sidebarToggleClicked = function (e, triggered) {
$allGutterToggleIcons.removeClass('fa-angle-double-left').addClass('fa-angle-double-right'); $allGutterToggleIcons.removeClass('fa-angle-double-left').addClass('fa-angle-double-right');
$('aside.right-sidebar').removeClass('right-sidebar-collapsed').addClass('right-sidebar-expanded'); $('aside.right-sidebar').removeClass('right-sidebar-collapsed').addClass('right-sidebar-expanded');
$('.layout-page').removeClass('right-sidebar-collapsed').addClass('right-sidebar-expanded'); $('.layout-page').removeClass('right-sidebar-collapsed').addClass('right-sidebar-expanded');
if (gl.lazyLoader) gl.lazyLoader.loadCheck();
} }
$this.attr('data-original-title', tooltipLabel); $this.attr('data-original-title', tooltipLabel);
......
---
title: Allow Issue and Merge Request sidebar to be toggled from collapsed state
merge_request: 22353
author:
type: fixed
/* eslint-disable no-var, one-var, one-var-declaration-per-line, no-return-assign, vars-on-top, jasmine/no-unsafe-spy, max-len */ /* eslint-disable no-var, one-var, one-var-declaration-per-line, no-return-assign, vars-on-top, max-len */
import $ from 'jquery'; import $ from 'jquery';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
...@@ -92,33 +92,5 @@ import Sidebar from '~/right_sidebar'; ...@@ -92,33 +92,5 @@ import Sidebar from '~/right_sidebar';
}); });
}); });
}); });
describe('sidebarToggleClicked', () => {
const event = jasmine.createSpyObj('event', ['preventDefault']);
beforeEach(() => {
spyOn($.fn, 'hasClass').and.returnValue(false);
});
afterEach(() => {
gl.lazyLoader = undefined;
});
it('calls loadCheck if lazyLoader is set', () => {
gl.lazyLoader = jasmine.createSpyObj('lazyLoader', ['loadCheck']);
Sidebar.prototype.sidebarToggleClicked(event);
expect(gl.lazyLoader.loadCheck).toHaveBeenCalled();
});
it('does not throw if lazyLoader is not defined', () => {
gl.lazyLoader = undefined;
const toggle = Sidebar.prototype.sidebarToggleClicked.bind(null, event);
expect(toggle).not.toThrow();
});
});
}); });
}).call(window); }).call(window);
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