LambrechtsWouter / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

context menu is always shown up #287

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I use jsPlumb.bind function to handle contextmenu events. In jquery, I can 
always return false to stop the default menu from being displayed. There should 
be a similar way to prevent the default menu from being displayed in jsPlumb 
too.

My Code:
--------
jsPlumb.bind("contextmenu", function(conn, originalEvent)
{
    if (confirm("Delete this connection ?"))
    {
        jsPlumb.deleteEndpoint(conn.endpoints[0].elementId, conn.endpoints[0]);
        jsPlumb.deleteEndpoint(conn.endpoints[1].elementId, conn.endpoints[1]);
        jsPlumb.detach(conn);
    }
    return false;
});

Original issue reported on code.google.com by sureshbh...@gmail.com on 23 Oct 2012 at 10:59

GoogleCodeExporter commented 8 years ago
oh! I just noticed!
I can use originalEvent.preventDefault();

How to delete this issue?

Original comment by sureshbh...@gmail.com on 23 Oct 2012 at 11:06

GoogleCodeExporter commented 8 years ago
i don't think issues can be deleted. no problem - i will just mark it invalid.  
thanks for the follow up.

Original comment by simon.po...@gmail.com on 23 Oct 2012 at 11:44