Fix dropdown-user placement and menu-left scroll on touchscreens (#2706)

pull/2711/head
Kim 2020-05-01 20:05:19 +02:00 committed by GitHub
parent d1261d9a3c
commit ca4b1594a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 2 deletions

View File

@ -11,7 +11,7 @@
<div class="logged-in-username">{{ user.username }}</div>
</div>
<div class="logged-in-more" ngbDropdown placement="right-top auto" container="body" autoClose="outside">
<div class="logged-in-more" ngbDropdown [placement]="placement" container="body" autoClose="outside">
<my-global-icon iconName="more-vertical" ngbDropdownToggle role="button"></my-global-icon>
<div ngbDropdownMenu>

View File

@ -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;

View File

@ -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()