diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2018-10-15 19:27:21 +0300 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-10-15 19:27:21 +0300 |
commit | bf47fc8b0c05bf57e18e985e2ad2569c625108b3 (patch) | |
tree | 49feb25f0eebfebcbec5fcd6276d2d4ca296adb2 | |
parent | b8e3a3de6f788658363503da89f40e0f2eff2c9d (diff) | |
parent | 2bbd16e840f4ab2fed9f0166e67a1e77628defb8 (diff) |
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
4 files changed, 6 insertions, 32 deletions
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index e8aac51a299..a88b575ad99 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -202,7 +202,6 @@ document.addEventListener('DOMContentLoaded', () => { $('.navbar-toggler').on('click', () => { $('.header-content').toggleClass('menu-expanded'); - gl.lazyLoader.loadCheck(); }); // Show/hide comments on diff diff --git a/app/assets/javascripts/right_sidebar.js b/app/assets/javascripts/right_sidebar.js index 64f3dde5be7..6b3753f7966 100644 --- a/app/assets/javascripts/right_sidebar.js +++ b/app/assets/javascripts/right_sidebar.js @@ -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); diff --git a/changelogs/unreleased/52532-unable-to-toggle-issuable-sidebar-out-of-collapsed-state.yml b/changelogs/unreleased/52532-unable-to-toggle-issuable-sidebar-out-of-collapsed-state.yml new file mode 100644 index 00000000000..9abad3d2cd8 --- /dev/null +++ b/changelogs/unreleased/52532-unable-to-toggle-issuable-sidebar-out-of-collapsed-state.yml @@ -0,0 +1,5 @@ +--- +title: Allow Issue and Merge Request sidebar to be toggled from collapsed state +merge_request: 22353 +author: +type: fixed diff --git a/spec/javascripts/right_sidebar_spec.js b/spec/javascripts/right_sidebar_spec.js index 936e8f16c52..43e4db4c712 100644 --- a/spec/javascripts/right_sidebar_spec.js +++ b/spec/javascripts/right_sidebar_spec.js @@ -1,4 +1,4 @@ -/* 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); |