diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/menu/menu.component.ts | 21 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html | 2 |
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 @@ | |||
1 | import { ViewportScroller } from '@angular/common' | ||
2 | import { HotkeysService } from 'angular2-hotkeys' | 1 | import { HotkeysService } from 'angular2-hotkeys' |
3 | import * as debug from 'debug' | 2 | import * as debug from 'debug' |
4 | import { switchMap } from 'rxjs/operators' | 3 | import { switchMap } from 'rxjs/operators' |
4 | import { ViewportScroller } from '@angular/common' | ||
5 | import { Component, OnInit, ViewChild } from '@angular/core' | 5 | import { Component, OnInit, ViewChild } from '@angular/core' |
6 | import { Router } from '@angular/router' | 6 | import { Router } from '@angular/router' |
7 | import { scrollToTop } from '@app/helpers' | ||
8 | import { AuthService, AuthStatus, AuthUser, MenuService, RedirectService, ScreenService, ServerService, UserService } from '@app/core' | 7 | import { AuthService, AuthStatus, AuthUser, MenuService, RedirectService, ScreenService, ServerService, UserService } from '@app/core' |
8 | import { scrollToTop } from '@app/helpers' | ||
9 | import { LanguageChooserComponent } from '@app/menu/language-chooser.component' | 9 | import { LanguageChooserComponent } from '@app/menu/language-chooser.component' |
10 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' | 10 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' |
11 | import { ServerConfig, UserRight, VideoConstant } from '@shared/models' | ||
12 | import { NgbDropdown, NgbDropdownConfig } from '@ng-bootstrap/ng-bootstrap' | ||
13 | import { PeertubeModalService } from '@app/shared/shared-main/peertube-modal/peertube-modal.service' | 11 | import { PeertubeModalService } from '@app/shared/shared-main/peertube-modal/peertube-modal.service' |
12 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | ||
13 | import { ServerConfig, UserRight, VideoConstant } from '@shared/models' | ||
14 | 14 | ||
15 | const logger = debug('peertube:menu:MenuComponent') | 15 | const 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 |