jerosoler / Drawflow

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

How to add reusable modal(popup) #599

Open Ashvi213 opened 1 year ago

Ashvi213 commented 1 year ago
  1. Double clicking is possible instead of editor.on('nodeselected')?
  2. Need to dynamically add modal with different fields for each nodes.
jerosoler commented 1 year ago

View:

Ashvi213 commented 1 year ago

Is it possible to add double click without adding html on the node? Used addeventlistener(dblclick) it also not working. (angular project)

jerosoler commented 1 year ago

I can't help you in angular. But this would be the native javascript event with addEventListener.

    editor.container.addEventListener('dblclick', (e) => {
        if(e.target.closest(".drawflow_content_node")?.parentElement) {
            alert(e.target.closest(".drawflow_content_node").parentElement.id);
        }
    });