problems with dialog events
Hey
I am trying to use drag and dragStop on a dialog. But somehow the mousemove event of the drag is not being terminated. Can anyone see what I'm doing wrong?
Basically I'm defining an area to the left of the screen, that when hovering a wire should be drawn (represented by a div). When moving away from that area, the wire should disappear. That part works, but after i drop the dialog, and the dragStop is executed (I can see it happening because of the alert in dropDialog function), the hovering effect of dragDialog continues to be in effect?
Thanks for your help
Carsten
- $("#file_dialog").dialog({
- drag: function(event, ui){
- dragDialog();
- },
- dragStop: function(event,ui){
- dropDialog();
- }
- });
- function dragDialog(){
var widthOfOuterDropzone = 20;
$(document).mousemove(function(e){
if(hovering){
if( e.pageX > widthOfOuterDropzone){
$('#wire').remove();
hovering = false;
}
}
else if(e.pageX <= widthOfOuterDropzone){
$('#bounding_box').append('<div id="wire"></div>');
hovering = true;
}
});
- }
- function dropDialog(){
- if(hovering){ alert("drop");}
- else{alert("drop2");}
- }