jerosoler / Drawflow

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

Is it possible to disable the right click (contextmenu) #203

Closed spapas closed 3 years ago

spapas commented 3 years ago

Hello, first of all thank you for this great project!

Second, is there a way to configure drawflow to not display the close button on right click on a node? I just want to display the normal browser right button context menu.

Thank you very much and kind regards, Serafeim

jerosoler commented 3 years ago

Hello @spapas

Thanks!

For view normal context menu and not display close button.

   editor.contextmenu = (e) => {
            editor.drag = false;
            editor.drag_point = false;
            editor.connection = false;
            editor.ele_selected = null;
            editor.editor_selected = false;
            editor.dispatch('contextmenu', e);      
          }

          editor.start();

Add code before start.

View other options: https://github.com/jerosoler/Drawflow/issues/80 https://github.com/jerosoler/Drawflow/issues/47 https://github.com/jerosoler/Drawflow/issues/187

spapas commented 3 years ago

Thank you so much for the quick and perfect solution and the recommendations! I am greateful!

Kind regards, Serafeim