jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.64k stars 721 forks source link

Rename modules #189

Closed mcesaro closed 3 years ago

mcesaro commented 3 years ago

It would be nice to have a editor.renameModule(oldName, newName) function. Might be handy when developinf, for wxample a multi tabbed editor where tab name is modue name,

jerosoler commented 3 years ago

Hi @mcesaro

I point it out to add.

While you can use:

editor.drawflow.drawflow["New_NAME"] = editor.drawflow.drawflow["Other"];
delete editor.drawflow.drawflow["Other"];

Also use if you are in the same module

editor.changeModule("New_NAME");

Jero

mcesaro commented 3 years ago

Hi @jerosoler, very good suggestions! I was already using the second method, and in some use cases the first one will work well. Thank you!