mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Wrap notification messages in <p> when needed
This commit is contained in:
@@ -86,6 +86,9 @@ RED.notifications = (function() {
|
|||||||
}
|
}
|
||||||
n.style.display = "none";
|
n.style.display = "none";
|
||||||
if (typeof msg === "string") {
|
if (typeof msg === "string") {
|
||||||
|
if (!/<p>/i.test(msg)) {
|
||||||
|
msg = "<p>"+msg+"</p>";
|
||||||
|
}
|
||||||
n.innerHTML = msg;
|
n.innerHTML = msg;
|
||||||
} else {
|
} else {
|
||||||
$(n).append(msg);
|
$(n).append(msg);
|
||||||
@@ -153,6 +156,9 @@ RED.notifications = (function() {
|
|||||||
var nn = n;
|
var nn = n;
|
||||||
return function(msg,options) {
|
return function(msg,options) {
|
||||||
if (typeof msg === "string") {
|
if (typeof msg === "string") {
|
||||||
|
if (!/<p>/i.test(msg)) {
|
||||||
|
msg = "<p>"+msg+"</p>";
|
||||||
|
}
|
||||||
nn.innerHTML = msg;
|
nn.innerHTML = msg;
|
||||||
} else {
|
} else {
|
||||||
$(nn).empty().append(msg);
|
$(nn).empty().append(msg);
|
||||||
|
Reference in New Issue
Block a user