Closed 1989levinu closed 2 years ago
Hello,
You can detect the right click like so:
editor.on('clickEnd', function(event) {
if(editor.connection_selected !== null && event.button === 2) {
alert("Right Click connection");
}
})
can i get this event inside connectionSelected event. My need is if it is regular click show connectionProperties and if it is rightclick invoke delete..[right click delete i'm using the current built-in functionality of drawflow.js].but my concern is when the connection is selected.inisde that event(connectionSelected event) ,i need to check whether it is normal click or right click.
The connectionSelected event does not return the event.
You can use the "click" or "clickEnd" event to save the button that is clicked. To then call the clicked button something similar to this:
let buttonClick = null;
editor.on('click', function(event) {
buttonClick = event.button;
})
editor.on('connectionSelected', function (connection) {
alert(buttonClick);
})
Thanks:-)
now i have called one method on editor.on('connectionSelected', function (connection) { setproperties(); } but i have to delete the connection on right click as normal.
how can i do this.. since connectinSelected event is get invoked both on right click and normal click