summaryrefslogtreecommitdiff
path: root/js/common.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-06 12:52:44 +0300
committerAndrew Dolgov <[email protected]>2018-12-06 12:52:44 +0300
commitd99d04a2ae21af1a67e7e7acfc9b1a5fe4273cac (patch)
tree36052da47742d01fe2717e8ee10cc43789cd73b7 /js/common.js
parent0ea0b606be508cce11a7e776f4491db9332ae5c6 (diff)
notify: use iconfont, update colors and increase height a bit
Diffstat (limited to 'js/common.js')
-rwxr-xr-xjs/common.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/js/common.js b/js/common.js
index 150288bc2..6fde1e3ce 100755
--- a/js/common.js
+++ b/js/common.js
@@ -170,8 +170,7 @@ const Notify = {
}
let msgfmt = "<span class=\"msg\">%s</span>".replace("%s", __(msg));
- let icon = false;
-
+ let icon = "";
notify.className = "notify";
@@ -180,22 +179,28 @@ const Notify = {
switch (kind) {
case this.KIND_INFO:
notify.addClassName("notify_info")
- icon = App.getInitParam("icon_information");
+ icon = "notifications";
break;
case this.KIND_ERROR:
notify.addClassName("notify_error");
- icon = App.getInitParam("icon_alert");
+ icon = "error";
break;
case this.KIND_PROGRESS:
notify.addClassName("notify_progress");
icon = App.getInitParam("icon_indicator_white")
break;
+ default:
+ icon = "notifications";
}
- if (icon) msgfmt = "<span><img src=\"%s\"></span>".replace("%s", icon) + msgfmt;
+ if (icon)
+ if (icon.indexOf("data:image") != -1)
+ msgfmt = "<img src=\"%s\">".replace("%s", icon) + msgfmt;
+ else
+ msgfmt = "<i class='material-icons icon-notify'>%s</i>".replace("%s", icon) + msgfmt;
- msgfmt += (" <span><img src=\"%s\" class='close' title=\"" +
- __("Click to close") + "\" onclick=\"Notify.close()\"></span>")
+ msgfmt += ("<i class='material-icons icon-close' title=\"" +
+ __("Click to close") + "\" onclick=\"Notify.close()\">close</i>")
.replace("%s", App.getInitParam("icon_cross"));
notify.innerHTML = msgfmt;