Open TheoCtla opened 4 months ago
Or if you can give me the name of the function that deletes the nodes, so that I can override it.
Thanks, so it'll be good if i override the function "RemoveNodeId" ?
Yes, no problem!
I've tried overriding the "RemoveNodeId" function but it doesn't work. I'd like to remove the deletion of two nodes in particular, do you have any advice?
For example by class.
editor.removeNodeId = function(id) {
const node = editor.getNodeFromId(id.slice(5));
if(node.class === "nodelete") {
return;
}
this.removeConnectionNodeId(id);
let moduleName = this.getModuleFromNodeId(id.slice(5));
if (this.module === moduleName) {
this.container.querySelector(`#${id}`).remove();
}
delete this.drawflow.drawflow[moduleName].data[id.slice(5)];
this.dispatch('nodeRemoved', id.slice(5));
}
editor.start();
editor.addNode("item", 1, 1, 700, 400, "nodelete", {}, 'A');
editor.addNode("item", 1, 1, 900, 700, "item", {}, 'B');
editor.addNode("item", 1, 1, 500, 550, "nodelete", {}, 'C');
I'd like to know if there's a function to prevent certain nodes from being deleted, I've tried it myself but it didn't work. Thanks