diff --git a/editor/js/main.js b/editor/js/main.js
index 09750b85e..9352cd18d 100644
--- a/editor/js/main.js
+++ b/editor/js/main.js
@@ -118,6 +118,7 @@
text: "Setup project files",
click: function() {
persistentNotifications[notificationId].close();
+ delete persistentNotifications[notificationId];
RED.projects.showFilesPrompt();
}
}
@@ -128,11 +129,13 @@
text: "No thanks",
click: function() {
persistentNotifications[notificationId].close();
+ delete persistentNotifications[notificationId];
}
}, {
text: "Create default project files",
click: function() {
persistentNotifications[notificationId].close();
+ delete persistentNotifications[notificationId];
RED.projects.createDefaultFileSet();
}
}
@@ -142,7 +145,7 @@
if (!persistentNotifications.hasOwnProperty(notificationId)) {
persistentNotifications[notificationId] = RED.notify(text,options);
} else {
- persistentNotifications[notificationId].update(text,msg.timeout);
+ persistentNotifications[notificationId].update(text,options);
}
} else if (persistentNotifications.hasOwnProperty(notificationId)) {
persistentNotifications[notificationId].close();
diff --git a/editor/js/ui/notifications.js b/editor/js/ui/notifications.js
index 1e2a50d53..e09c1f22d 100644
--- a/editor/js/ui/notifications.js
+++ b/editor/js/ui/notifications.js
@@ -85,18 +85,34 @@ RED.notify = (function() {
n.update = (function() {
var nn = n;
- return function(msg,timeout) {
+ return function(msg,options) {
if (typeof msg === "string") {
nn.innerHTML = msg;
} else {
$(nn).empty().append(msg);
}
+ var timeout;
+ if (typeof options === 'number') {
+ timeout = options;
+ } else if (options !== undefined) {
+ timeout = options.timeout;
+ if (options.buttons) {
+ var buttonSet = $('
').appendTo(nn)
+ options.buttons.forEach(function(buttonDef) {
+ var b = $('