From 81a1999ca565f3cf25eb7ca1d19f91d2525700ae Mon Sep 17 00:00:00 2001 From: Wieland Lindenthal Date: Tue, 17 Dec 2019 23:33:49 +0100 Subject: [PATCH] Improve code climate --- .../app/components/main-menu/main-menu-toggle.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/components/main-menu/main-menu-toggle.service.ts b/frontend/src/app/components/main-menu/main-menu-toggle.service.ts index 47af297276..bb00c42edf 100644 --- a/frontend/src/app/components/main-menu/main-menu-toggle.service.ts +++ b/frontend/src/app/components/main-menu/main-menu-toggle.service.ts @@ -66,7 +66,7 @@ export class MainMenuToggleService { } public initializeMenu():void { - if (!this.mainMenu) return; + if (!this.mainMenu) { return; } this.elementWidth = parseInt(window.OpenProject.guardedLocalStorage(this.localStorageKey) as string); @@ -77,7 +77,7 @@ export class MainMenuToggleService { } let currentProject:CurrentProjectService = this.injector.get(CurrentProjectService); - if (jQuery(document.body).hasClass('controller-my') && this.elementWidth == 0 || currentProject.id === null) { + if (jQuery(document.body).hasClass('controller-my') && this.elementWidth === 0 || currentProject.id === null) { this.saveWidth(this.defaultWidth); } @@ -122,9 +122,8 @@ export class MainMenuToggleService { public closeWhenOnMobile():void { if (this.deviceService.isMobile) { - this.closeMenu() + this.closeMenu(); } - ; } private setToggleTitle():void { @@ -144,7 +143,7 @@ export class MainMenuToggleService { // Leave a minimum amount of space for space fot the content let maxMenuWidth = window.innerWidth - 520; - if (width != undefined && width > maxMenuWidth) { + if (width !== undefined && width > maxMenuWidth) { width = maxMenuWidth; }