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

Add node delete button to edit dialog

This commit is contained in:
Nick O'Leary 2016-11-04 14:29:04 +00:00
parent 0ca3cdb9ae
commit 5cdafc50fb

View File

@ -525,6 +525,33 @@ RED.editor = (function() {
var trayOptions = {
title: getEditStackTitle(),
buttons: [
{
id: "node-dialog-delete",
class: 'leftButton',
text: RED._("common.label.delete"),
click: function() {
var startDirty = RED.nodes.dirty();
var removedNodes = [];
var removedLinks = [];
var removedEntities = RED.nodes.remove(editing_node.id);
removedNodes.push(editing_node);
removedNodes = removedNodes.concat(removedEntities.nodes);
removedLinks = removedLinks.concat(removedEntities.links);
var historyEvent = {
t:'delete',
nodes:removedNodes,
links:removedLinks,
changes: {},
dirty: startDirty
}
RED.nodes.dirty(true);
RED.view.redraw(true);
RED.history.push(historyEvent);
RED.tray.close();
}
},
{
id: "node-dialog-cancel",
text: RED._("common.label.cancel"),