Change account switching dropdown to align with the right side (#1248)

This commit is contained in:
Oscar Hinton 2022-01-20 16:32:05 +01:00 committed by GitHub
parent 80c9196e44
commit 0edee78da1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,7 @@
[cdkConnectedOverlayBackdropClass]="'cdk-overlay-transparent-backdrop'"
(backdropClick)="toggle()"
[cdkConnectedOverlayOpen]="showSwitcher && isOpen"
[cdkConnectedOverlayPositions]="overlayPostition"
cdkConnectedOverlayMinWidth="250px"
>
<div class="account-switcher-dropdown" [@transformPanel]="'open'">

View File

@ -1,6 +1,6 @@
import { animate, state, style, transition, trigger } from "@angular/animations";
import { ConnectedPosition } from "@angular/cdk/overlay";
import { Component, OnInit } from "@angular/core";
import { Router } from "@angular/router";
import { MessagingService } from "jslib-common/abstractions/messaging.service";
import { StateService } from "jslib-common/abstractions/state.service";
@ -55,6 +55,14 @@ export class AccountSwitcherComponent implements OnInit {
accounts: { [userId: string]: SwitcherAccount } = {};
activeAccountEmail: string;
serverUrl: string;
overlayPostition: ConnectedPosition[] = [
{
originX: "end",
originY: "bottom",
overlayX: "end",
overlayY: "top",
},
];
get showSwitcher() {
return !Utils.isNullOrWhitespace(this.activeAccountEmail);