New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent the deletion of certain nodes #826
Comments
Or if you can give me the name of the function that deletes the nodes, so that I can override it. |
View this: |
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: