aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/menu/top-menu-dropdown.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/menu/top-menu-dropdown.component.ts')
-rw-r--r--client/src/app/shared/menu/top-menu-dropdown.component.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.ts b/client/src/app/shared/menu/top-menu-dropdown.component.ts
index f98240804..3f121e785 100644
--- a/client/src/app/shared/menu/top-menu-dropdown.component.ts
+++ b/client/src/app/shared/menu/top-menu-dropdown.component.ts
@@ -11,6 +11,7 @@ import { Subscription } from 'rxjs'
11import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' 11import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap'
12import { GlobalIconName } from '@app/shared/images/global-icon.component' 12import { GlobalIconName } from '@app/shared/images/global-icon.component'
13import { ScreenService } from '@app/shared/misc/screen.service' 13import { ScreenService } from '@app/shared/misc/screen.service'
14import { MenuService } from '@app/core/menu'
14 15
15export type TopMenuDropdownParam = { 16export type TopMenuDropdownParam = {
16 label: string 17 label: string
@@ -36,7 +37,6 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
36 37
37 suffixLabels: { [ parentLabel: string ]: string } 38 suffixLabels: { [ parentLabel: string ]: string }
38 hasIcons = false 39 hasIcons = false
39 container: undefined | 'body' = undefined
40 isModalOpened = false 40 isModalOpened = false
41 currentMenuEntryIndex: number 41 currentMenuEntryIndex: number
42 42
@@ -46,11 +46,17 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
46 constructor ( 46 constructor (
47 private router: Router, 47 private router: Router,
48 private modalService: NgbModal, 48 private modalService: NgbModal,
49 private screen: ScreenService 49 private screen: ScreenService,
50 private menuService: MenuService
50 ) { } 51 ) { }
51 52
52 get isInSmallView () { 53 get isInSmallView () {
53 return this.screen.isInSmallView() 54 let marginLeft = 0
55 if (this.menuService.isMenuDisplayed) {
56 marginLeft = this.menuService.menuWidth
57 }
58
59 return this.screen.isInSmallView(marginLeft)
54 } 60 }
55 61
56 ngOnInit () { 62 ngOnInit () {
@@ -63,11 +69,6 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
63 this.hasIcons = this.menuEntries.some( 69 this.hasIcons = this.menuEntries.some(
64 e => e.children && e.children.some(c => !!c.iconName) 70 e => e.children && e.children.some(c => !!c.iconName)
65 ) 71 )
66
67 // We have to set body for the container to avoid scroll overflow on mobile and small views
68 if (this.isInSmallView) {
69 this.container = 'body'
70 }
71 } 72 }
72 73
73 ngOnDestroy () { 74 ngOnDestroy () {