From ed3c0e42fb8a120424837c1b7d14e2ee5555d2cd Mon Sep 17 00:00:00 2001 From: Paul-Vincent Roll Date: Tue, 12 Apr 2016 20:54:30 +0200 Subject: [PATCH] Added Font Awesome Support into alerts. --- modules/default/alert/README.md | 7 +++++++ modules/default/alert/alert.js | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/default/alert/README.md b/modules/default/alert/README.md index ced23b42..5c04848c 100644 --- a/modules/default/alert/README.md +++ b/modules/default/alert/README.md @@ -135,6 +135,13 @@ self.sendNotification("SHOW_ALERT", {});
Default value: none + + imageFA (optional) + Font Awesome icon to show in the alert
+
Possible values: See Font Awsome website. +
Default value: none + + imageHeight (optional even with imageUrl set) Height of the image
diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index 1a8c55dd..58e5214f 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -41,11 +41,13 @@ Module.register("alert",{ //Set standard params if not provided by module if (typeof params.timer === "undefined") { params.timer = null; } if (typeof params.imageHeight === "undefined") { params.imageHeight = "80px"; } - if (typeof params.imageUrl === "undefined") { + if (typeof params.imageUrl === "undefined" && typeof params.imageFA === "undefined") { params.imageUrl = null; image = ""; - } else { + } else if (typeof params.imageFA === "undefined"){ image = "
"; + } else if (typeof params.imageUrl === "undefined"){ + image = "
"; } //Create overlay var overlay = document.createElement("div");