Wrap notification messages in <p> when needed

This commit is contained in:
Nick O'Leary
2018-01-28 10:57:05 +00:00
parent dd7bb28b6a
commit 50956c51f7

View File

@@ -86,6 +86,9 @@ RED.notifications = (function() {
}
n.style.display = "none";
if (typeof msg === "string") {
if (!/<p>/i.test(msg)) {
msg = "<p>"+msg+"</p>";
}
n.innerHTML = msg;
} else {
$(n).append(msg);
@@ -153,6 +156,9 @@ RED.notifications = (function() {
var nn = n;
return function(msg,options) {
if (typeof msg === "string") {
if (!/<p>/i.test(msg)) {
msg = "<p>"+msg+"</p>";
}
nn.innerHTML = msg;
} else {
$(nn).empty().append(msg);