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

oneditdelete should be available to all node types

Closes #1346
This commit is contained in:
Nick O'Leary 2018-01-23 21:28:58 +00:00
parent dc3d89008d
commit cc9011cd68
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -272,10 +272,19 @@ RED.nodes = (function() {
if (updatedConfigNode) {
RED.workspaces.refresh();
}
try {
if (node._def.oneditdelete) {
node._def.oneditdelete.call(node);
}
} catch(err) {
console.log("oneditdelete",node.id,node.type,err.toString());
}
RED.events.emit('nodes:remove',node);
}
}
if (node && node._def.onremove) {
// Deprecated: never documented but used by some early nodes
console.log("Deprecated API warning: node type ",node.type," has an onremove function - should be oneditremove - please report");
node._def.onremove.call(n);
}
return {links:removedLinks,nodes:removedNodes};