mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Better handling of empty projects and lifecycle
This commit is contained in:
@@ -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 = $('<div style="margin-top: 20px;" class="ui-dialog-buttonset"></div>').appendTo(nn)
|
||||
options.buttons.forEach(function(buttonDef) {
|
||||
var b = $('<button>').html(buttonDef.text).click(buttonDef.click).appendTo(buttonSet);
|
||||
if (buttonDef.class) {
|
||||
b.addClass(buttonDef.class);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
if (timeout !== undefined && timeout > 0) {
|
||||
window.clearTimeout(nn.timeoutid);
|
||||
nn.timeoutid = window.setTimeout(nn.close,timeout);
|
||||
} else {
|
||||
window.clearTimeout(nn.timeoutid);
|
||||
}
|
||||
|
||||
}
|
||||
})();
|
||||
|
||||
|
@@ -1067,7 +1067,7 @@ RED.projects = (function() {
|
||||
'open': (function() {
|
||||
var selectedProject;
|
||||
return {
|
||||
title: "Open a project", // TODO: NLS
|
||||
title: "Select a project to open", // TODO: NLS
|
||||
content: function() {
|
||||
return createProjectList({
|
||||
canSelectActive: false,
|
||||
@@ -1111,6 +1111,7 @@ RED.projects = (function() {
|
||||
'delete': (function() {
|
||||
var selectedProject;
|
||||
return {
|
||||
title: "Select a project to delete", // TODO: NLS
|
||||
content: function() {
|
||||
return createProjectList({
|
||||
canSelectActive: false,
|
||||
|
@@ -55,7 +55,7 @@ RED.sidebar.info = (function() {
|
||||
});
|
||||
nodeSection.expand();
|
||||
infoSection = sections.add({
|
||||
title: RED._("sidebar.info.help"),
|
||||
title: RED._("sidebar.info.nodeHelp"),
|
||||
collapsible: true
|
||||
});
|
||||
infoSection.expand();
|
||||
|
Reference in New Issue
Block a user