From b0344cb28ce07da8c7e342214e86066b9d9fa44c Mon Sep 17 00:00:00 2001 From: David Sleeckx Date: Wed, 29 Jun 2016 14:53:42 +0200 Subject: [PATCH] Added showAlert on vi-app --- src/WebComponents/App/app.ts | 38 ++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/WebComponents/App/app.ts b/src/WebComponents/App/app.ts index 061ed89a..238a73fa 100644 --- a/src/WebComponents/App/app.ts +++ b/src/WebComponents/App/app.ts @@ -390,6 +390,26 @@ namespace Vidyano.WebComponents { return this.showDialog(new Vidyano.WebComponents.MessageDialog(options)); } + showAlert(notification: string, type: Vidyano.NotificationType = Vidyano.NotificationType.Notice, duration: number = 3000) { + switch (type) { + case NotificationType.Error: + alertify.log(notification, "error", duration); + break; + + case NotificationType.OK: + alertify.log(notification, "success", duration); + break; + + case NotificationType.Warning: + alertify.log(notification, "warning", duration); + break; + + case NotificationType.Notice: + alertify.log(notification, "notice", duration); + break; + } + } + private _computeIsProfiling(isSignedIn: boolean, profile: boolean, profilerLoaded: boolean): boolean { const isProfiling = isSignedIn && profile; if (isProfiling && !Polymer.isInstance(this.$["profiler"])) { @@ -904,23 +924,7 @@ namespace Vidyano.WebComponents { if (typeof notification === "object") notification = notification["message"]; - switch (type) { - case NotificationType.Error: - alertify.log(notification, "error", duration); - break; - - case NotificationType.OK: - alertify.log(notification, "success", duration); - break; - - case NotificationType.Warning: - alertify.log(notification, "warning", duration); - break; - - case NotificationType.Notice: - alertify.log(notification, "notice", duration); - break; - } + this.app.showAlert(notification, type, duration); } onSelectReference(query: Vidyano.Query): Promise {