I have a situation in which a node (Raphael rect) has event drag attached to it.
r4.drag(dragMove, dragStart, dragStop);
In dragStop handler I am distinguishing between drag and rightclick events
if (editLabelFlag == false) {
if (event.which == 3) {
event.preventDefault();
$('#contextmenu').slideDown('fast').delay(1000).slideUp();
// code for
}
} else {
// drag code
}
I am setting the editLabelFlag to true in the dragMove handler to distinguish between drag and click
To stop showing the browser context menu I have given event.preventDefault().
The problem I am facing is that this happens flawlessly for the first time and for all later right clicks on the node I get only the browser context menu. I have checked in Firebug and see that the contextmenu div always remains display none and only the first time it becomes display block. I have tried using the return false instead of event.preventDefault but that shows my menu below the browsers menu.
Is the preventDefault causing this problem?
Please provide some
It was not due to the browser stopping any events, actually I was creating a clone and dragging the original. In dragstart the clone was put in originals place and not removed during click. Hence no events mapped for original worked for clone and hence the click happened only once.
Thanks for your time