[ACA-2208] Hide app menu on swipe (#970)

This commit is contained in:
Suzana Dirla 2019-02-25 22:35:17 +02:00 committed by Denys Vuika
parent 9458ce1785
commit c7328c7caf
2 changed files with 17 additions and 1 deletions

View File

@ -178,4 +178,20 @@ describe('AppLayoutComponent', () => {
expect(component.layout.container.toggleMenu).toHaveBeenCalled();
});
it('should close menu on mobile screen size also when minimizeSidenav true', () => {
fixture.detectChanges();
component.minimizeSidenav = true;
component.layout.container = {
isMobileScreenSize: true,
toggleMenu: () => {}
};
spyOn(component.layout.container, 'toggleMenu');
fixture.detectChanges();
component.hideMenu(<any>{ preventDefault: () => {} });
expect(component.layout.container.toggleMenu).toHaveBeenCalled();
});
});

View File

@ -153,7 +153,7 @@ export class AppLayoutComponent implements OnInit, OnDestroy {
}
hideMenu(event: Event) {
if (!this.minimizeSidenav && this.layout.container.isMobileScreenSize) {
if (this.layout.container.isMobileScreenSize) {
event.preventDefault();
this.layout.container.toggleMenu();
}