pull/14735/head
Mahmut Gundogdu 3 years ago
parent 5f6c5e01ea
commit 50bce35426

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

Loading…
Cancel
Save