Tim Seguine
Tim Seguine

Reputation: 2914

Stop jquery droppable from accepting when droptarget is completely obscured by another element

In my user interface, I have many popup dialogs, some of which contain jquery droppable targets. They work fine, but when one popup is completely covering a drop target, I would like to stop the event from propagating.

I tried to put an event handler on the popup dialog to stop the drop event from propagating, but that didnt work.

Using the scope and accept options don't really seem to be viable, since the objects and targets are more or less identical.

Any ideas?

Upvotes: 0

Views: 315

Answers (1)

Nal
Nal

Reputation: 2771

The simplest method is probably to use the disable method on the occluded dropables when you open a dialog. Then call the enable method in the dialog close event. It might also make sense to just disable all droppables not in the most recently opened dialog.

Setting the greedy option to true unfortunately only stops the propagation for nested dropables so that also isn't an option for you.

Upvotes: 1

Related Questions