From ca4b1594a77d1a31188dde1e5f6f7a900cd29118 Mon Sep 17 00:00:00 2001 From: Kim <1877318+kimsible@users.noreply.github.com> Date: Fri, 1 May 2020 20:05:19 +0200 Subject: [PATCH] Fix dropdown-user placement and menu-left scroll on touchscreens (#2706) --- client/src/app/menu/menu.component.html | 2 +- client/src/app/menu/menu.component.scss | 4 ++++ client/src/app/menu/menu.component.ts | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.html index 32e48d6b6..1cb51ef55 100644 --- a/client/src/app/menu/menu.component.html +++ b/client/src/app/menu/menu.component.html @@ -11,7 +11,7 @@
{{ user.username }}
-
+
diff --git a/client/src/app/menu/menu.component.scss b/client/src/app/menu/menu.component.scss index 9ae40493d..5bff0c328 100644 --- a/client/src/app/menu/menu.component.scss +++ b/client/src/app/menu/menu.component.scss @@ -27,6 +27,10 @@ menu { overflow-y: auto; } + @media not all and (hover: hover) and (pointer: fine) { + overflow-y: auto; + } + &.logged-in { .panel-block { margin-bottom: 20px; diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts index 75bae090e..015c14bce 100644 --- a/client/src/app/menu/menu.component.ts +++ b/client/src/app/menu/menu.component.ts @@ -8,6 +8,7 @@ import { HotkeysService } from 'angular2-hotkeys' import { ServerConfig, VideoConstant } from '@shared/models' import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' import { I18n } from '@ngx-translate/i18n-polyfill' +import { ScreenService } from '@app/shared/misc/screen.service' @Component({ selector: 'my-menu', @@ -43,8 +44,21 @@ export class MenuComponent implements OnInit { private serverService: ServerService, private redirectService: RedirectService, private hotkeysService: HotkeysService, + private screenService: ScreenService, private i18n: I18n - ) {} + ) { } + + get isInMobileView () { + return this.screenService.isInMobileView() + } + + get placement () { + if (this.isInMobileView) { + return 'left-top auto' + } else { + return 'right-top auto' + } + } ngOnInit () { this.serverConfig = this.serverService.getTmpConfig() -- 2.25.1