From 50bce3542688f52d9bbafa46859ad97f702eacb1 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Wed, 23 Nov 2022 15:14:31 +0300 Subject: [PATCH] Reformat --- .../toast-container.component.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/toast-container/toast-container.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/toast-container/toast-container.component.ts index 7913e65876..2ce2367a17 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/toast-container/toast-container.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/toast-container/toast-container.component.ts @@ -1,7 +1,7 @@ -import { Component, HostListener, Input, OnInit } from '@angular/core'; -import { ReplaySubject } from 'rxjs'; -import { toastInOut } from '../../animations/toast.animations'; -import { Toaster } from '../../models/toaster'; +import {Component, HostListener, Input, OnInit} from '@angular/core'; +import {ReplaySubject} from 'rxjs'; +import {toastInOut} from '../../animations/toast.animations'; +import {Toaster} from '../../models/toaster'; @Component({ selector: 'abp-toast-container', @@ -33,27 +33,27 @@ export class ToastContainerComponent implements OnInit { @Input() toastKey?: string; - screenWidth: number; ngOnInit() { this.setDefaultRight(); this.toasts$.subscribe(toasts => { this.toasts = this.toastKey ? toasts.filter(t => { - return t.options && t.options.containerKey !== this.toastKey; - }) + return t.options && t.options.containerKey !== this.toastKey; + }) : toasts; }); } @HostListener('window:resize', ['$event']) onWindowResize() { - this.setDefaultRight(); - } - setDefaultRight() { - + this.setDefaultRight(); + } + + setDefaultRight() { + const screenWidth = window.innerWidth; - if(screenWidth < 768 && this.right == this.defaultRight) { + if (screenWidth < 768 && this.right == this.defaultRight) { this.right = this.defaultMobileRight; } }