I have two listeners. One is the droppable class from jquery UI
$("#myDiv").droppable({
drop: function( event, ui ) {
console.log('I happened');
if (window.draggingMove == true) {
alert('I want to get here but I never make it');
}
}
});
I also have a higher up listener that clears things universally.
$(document).on('mouseup', function(event) {
window.draggingMove = false;
console.log('all dragging is cleared');
});
However, when I complete the "drop" action and they both trigger, yet the second one triggers first, so i see this in my console.
"all dragging is cleared"
"I happened"
It was my understanding that droppable should trigger first since its attached to myDiv. How can I get that to happen before document listener?
Any ideas?