mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Added Font Awesome Support into alerts.
This commit is contained in:
parent
d72d6d925e
commit
ed3c0e42fb
@ -135,6 +135,13 @@ self.sendNotification("SHOW_ALERT", {});
|
||||
<br><b>Default value:</b> <code>none</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>imageFA</code> (optional)</td>
|
||||
<td>Font Awesome icon to show in the alert<br>
|
||||
<br><b>Possible values:</b> See <a href="http://fontawesome.io/icons/" target="_blank">Font Awsome</a> website.
|
||||
<br><b>Default value:</b> <code>none</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>imageHeight</code> (optional even with imageUrl set)</td>
|
||||
<td>Height of the image<br>
|
||||
|
@ -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 = "<img src='" + (params.imageUrl).toString() + "' height=" + (params.imageHeight).toString() + " style='margin-bottom: 10px;'/><br />";
|
||||
} else if (typeof params.imageUrl === "undefined"){
|
||||
image = "<span class='" + "fa fa-" + params.imageFA + "' style='margin-bottom: 10px;color: #fff;font-size:" + (params.imageHeight).toString() + ";'/></span><br />";
|
||||
}
|
||||
//Create overlay
|
||||
var overlay = document.createElement("div");
|
||||
|
Loading…
x
Reference in New Issue
Block a user