You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
937 B
27 lines
937 B
import { NotificationService } from "./NotificationService";
|
|
// @ts-ignore
|
|
import * as alertify from "alertifyjs";
|
|
export class AlertifyNotificationService implements NotificationService {
|
|
private readonly _alertify = alertify;
|
|
constructor() {
|
|
this._alertify.set('notifier', 'position', 'top-center');
|
|
}
|
|
success(message: string): void {
|
|
this._alertify.success(message)
|
|
}
|
|
error(message: string): void {
|
|
this._alertify.error(message);
|
|
}
|
|
errorWithDelay(message: string, delay: number): void {
|
|
const _delay = this._alertify.get('notifier', 'delay');
|
|
this._alertify.set('notifier', 'delay', delay);
|
|
this._alertify.error(message);
|
|
this._alertify.set('notifier', 'delay', _delay);
|
|
}
|
|
warning(message: string): void {
|
|
this._alertify.warning(message);
|
|
}
|
|
message(message: string): void {
|
|
this._alertify.message(message);
|
|
}
|
|
}
|