Commit bf47fc8b authored by Clement Ho's avatar Clement Ho

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
parents b8e3a3de 2bbd16e8
......@@ -202,7 +202,6 @@ document.addEventListener('DOMContentLoaded', () => {
$('.navbar-toggler').on('click', () => {
$('.header-content').toggleClass('menu-expanded');
gl.lazyLoader.loadCheck();
});
// Show/hide comments on diff
......
......@@ -57,8 +57,6 @@ Sidebar.prototype.sidebarToggleClicked = function (e, triggered) {
$allGutterToggleIcons.removeClass('fa-angle-double-left').addClass('fa-angle-double-right');
$('aside.right-sidebar').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);
......
---
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, no-return-assign, vars-on-top, jasmine/no-unsafe-spy */
/* eslint-disable no-var, one-var, no-return-assign, vars-on-top */
import $ from 'jquery';
import MockAdapter from 'axios-mock-adapter';
......@@ -94,33 +94,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);
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