mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add RED.notifications.hide flag
For use by the UI tests to suppress notifications from being displayed in the editor. It is not for use by end-users and not exposed in any way other than via javascript injection by the UI tests
This commit is contained in:
parent
d9aadf9d98
commit
09cd710f66
@ -16,6 +16,10 @@
|
|||||||
RED.notifications = (function() {
|
RED.notifications = (function() {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
If RED.notifications.hide is set to true, all notifications will be hidden.
|
||||||
|
This is to help with UI testing in certain cases and not intended for the
|
||||||
|
end-user.
|
||||||
|
|
||||||
// Example usage for a modal dialog with buttons
|
// Example usage for a modal dialog with buttons
|
||||||
var myNotification = RED.notify("This is the message to display",{
|
var myNotification = RED.notify("This is the message to display",{
|
||||||
modal: true,
|
modal: true,
|
||||||
@ -108,7 +112,9 @@ RED.notifications = (function() {
|
|||||||
|
|
||||||
|
|
||||||
$("#notifications").append(n);
|
$("#notifications").append(n);
|
||||||
$(n).slideDown(300);
|
if (!RED.notifications.hide) {
|
||||||
|
$(n).slideDown(300);
|
||||||
|
}
|
||||||
n.close = (function() {
|
n.close = (function() {
|
||||||
var nn = n;
|
var nn = n;
|
||||||
return function() {
|
return function() {
|
||||||
@ -123,9 +129,13 @@ RED.notifications = (function() {
|
|||||||
notificationButtonWrapper.hide();
|
notificationButtonWrapper.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$(nn).slideUp(300, function() {
|
if (!RED.notifications.hide) {
|
||||||
|
$(nn).slideUp(300, function() {
|
||||||
|
nn.parentNode.removeChild(nn);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
nn.parentNode.removeChild(nn);
|
nn.parentNode.removeChild(nn);
|
||||||
});
|
}
|
||||||
if (options.modal) {
|
if (options.modal) {
|
||||||
$("#full-shade").hide();
|
$("#full-shade").hide();
|
||||||
}
|
}
|
||||||
@ -138,7 +148,9 @@ RED.notifications = (function() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
nn.hidden = true;
|
nn.hidden = true;
|
||||||
$(nn).slideUp(300);
|
if (!RED.notifications.hide) {
|
||||||
|
$(nn).slideUp(300);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
n.showNotification = (function() {
|
n.showNotification = (function() {
|
||||||
@ -148,7 +160,9 @@ RED.notifications = (function() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
nn.hidden = false;
|
nn.hidden = false;
|
||||||
$(nn).slideDown(300);
|
if (!RED.notifications.hide) {
|
||||||
|
$(nn).slideDown(300);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user