Commit 05ec7b35 authored by Lukas Eipert's avatar Lukas Eipert

Remove obsolete usage of gl.lazyLoader.loadCheck

In [!21565][0] we removed the loadCheck function from the LazyLoader for
images. The function seemed to be obsolete before anyhow, because we
make use of the MutationObserver in order to detect elements added /
removed from the DOM.

[0]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21565
parent 75b6ed8d
...@@ -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
...@@ -94,33 +94,5 @@ import Sidebar from '~/right_sidebar'; ...@@ -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); }).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