1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

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);