aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-26 15:56:49 +0200
committerChocobozzz <me@florianbigard.com>2021-04-26 15:56:49 +0200
commit27f4a1ecbc510d315ba12ee5368632b8804e69cf (patch)
treeb68153269e61f48d9c9634f3a5fc173a71d4512f /client
parent03a5e95ce184a418341c349050dfa889375da9b9 (diff)
downloadPeerTube-27f4a1ecbc510d315ba12ee5368632b8804e69cf.tar.gz
PeerTube-27f4a1ecbc510d315ba12ee5368632b8804e69cf.tar.zst
PeerTube-27f4a1ecbc510d315ba12ee5368632b8804e69cf.zip
Fix menu dropdown overflow
Weird issue conflicting with the dropdown config from the menu component
Diffstat (limited to 'client')
-rw-r--r--client/src/app/menu/menu.component.ts21
-rw-r--r--client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html2
2 files changed, 9 insertions, 14 deletions
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts
index 9b6b7cda5..8fa1de326 100644
--- a/client/src/app/menu/menu.component.ts
+++ b/client/src/app/menu/menu.component.ts
@@ -1,16 +1,16 @@
1import { ViewportScroller } from '@angular/common'
2import { HotkeysService } from 'angular2-hotkeys' 1import { HotkeysService } from 'angular2-hotkeys'
3import * as debug from 'debug' 2import * as debug from 'debug'
4import { switchMap } from 'rxjs/operators' 3import { switchMap } from 'rxjs/operators'
4import { ViewportScroller } from '@angular/common'
5import { Component, OnInit, ViewChild } from '@angular/core' 5import { Component, OnInit, ViewChild } from '@angular/core'
6import { Router } from '@angular/router' 6import { Router } from '@angular/router'
7import { scrollToTop } from '@app/helpers'
8import { AuthService, AuthStatus, AuthUser, MenuService, RedirectService, ScreenService, ServerService, UserService } from '@app/core' 7import { AuthService, AuthStatus, AuthUser, MenuService, RedirectService, ScreenService, ServerService, UserService } from '@app/core'
8import { scrollToTop } from '@app/helpers'
9import { LanguageChooserComponent } from '@app/menu/language-chooser.component' 9import { LanguageChooserComponent } from '@app/menu/language-chooser.component'
10import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' 10import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component'
11import { ServerConfig, UserRight, VideoConstant } from '@shared/models'
12import { NgbDropdown, NgbDropdownConfig } from '@ng-bootstrap/ng-bootstrap'
13import { PeertubeModalService } from '@app/shared/shared-main/peertube-modal/peertube-modal.service' 11import { PeertubeModalService } from '@app/shared/shared-main/peertube-modal/peertube-modal.service'
12import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'
13import { ServerConfig, UserRight, VideoConstant } from '@shared/models'
14 14
15const logger = debug('peertube:menu:MenuComponent') 15const logger = debug('peertube:menu:MenuComponent')
16 16
@@ -56,22 +56,17 @@ export class MenuComponent implements OnInit {
56 private screenService: ScreenService, 56 private screenService: ScreenService,
57 private menuService: MenuService, 57 private menuService: MenuService,
58 private modalService: PeertubeModalService, 58 private modalService: PeertubeModalService,
59 private dropdownConfig: NgbDropdownConfig,
60 private router: Router 59 private router: Router
61 ) { 60 ) { }
62 this.dropdownConfig.container = 'body'
63 }
64 61
65 get isInMobileView () { 62 get isInMobileView () {
66 return this.screenService.isInMobileView() 63 return this.screenService.isInMobileView()
67 } 64 }
68 65
69 get dropdownContainer () { 66 get dropdownContainer () {
70 if (this.isInMobileView) { 67 if (this.isInMobileView) return null
71 return null 68
72 } else { 69 return 'body' as 'body'
73 return this.dropdownConfig.container
74 }
75 } 70 }
76 71
77 get language () { 72 get language () {
diff --git a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html
index ee3346ea9..d884e75b2 100644
--- a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html
+++ b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html
@@ -4,7 +4,7 @@
4 <a *ngIf="menuEntry.routerLink && isDisplayed(menuEntry)" [routerLink]="menuEntry.routerLink" routerLinkActive="active" class="title-page title-page-settings" #routerLink (click)="onActiveLinkScrollToTop(routerLink)">{{ menuEntry.label }}</a> 4 <a *ngIf="menuEntry.routerLink && isDisplayed(menuEntry)" [routerLink]="menuEntry.routerLink" routerLinkActive="active" class="title-page title-page-settings" #routerLink (click)="onActiveLinkScrollToTop(routerLink)">{{ menuEntry.label }}</a>
5 5
6 <div *ngIf="!menuEntry.routerLink && isDisplayed(menuEntry)" ngbDropdown class="parent-entry" 6 <div *ngIf="!menuEntry.routerLink && isDisplayed(menuEntry)" ngbDropdown class="parent-entry"
7 #dropdown="ngbDropdown" autoClose="true"> 7 #dropdown="ngbDropdown" autoClose="true" container="body">
8 <span 8 <span
9 *ngIf="isInSmallView" 9 *ngIf="isInSmallView"
10 tabindex=0 10 tabindex=0