Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#2057 closed enhancement (fixed)

Droppable tolerance for draggable that completely overlaps

Reported by: indirect Owned by: rdworth
Priority: major Milestone: 1.5
Component: ui.core Version: 1.2.1
Keywords: Cc: [email protected]
Blocked by: Blocking:


When a draggable item completely overlaps a droppable item, there is no tolerance that will register the draggable as "over". By adding a droppable tolerance, it is possible to make this happen.

For an example of why I would want this, see The pieces should only be able to be dropped when they are on top of one of the marked hexes.

Here is the case which I added to the switch (toleranceMode) case statement:

case 'overlap':
	dao = $(oDrag.helper).offset();
	dpo = oDrop.offset;
	return ( == && dao.left == dpo.left );

I have attached the case statement as a patch against ui.droppable.js, but since I am a jQuery newbie, there's probably a better way to do it. Thanks!

Attachments (1)

overlap.diff (540 bytes) - added by indirect 15 years ago.

Download all attachments as: .zip

Change History (5)

Changed 15 years ago by indirect

Attachment: overlap.diff added

comment:1 Changed 15 years ago by rdworth

Owner: set to rworth
Status: newassigned

comment:2 Changed 15 years ago by paul

Resolution: fixed
Status: assignedclosed

check out the tolerance "fit": this should be exactly what you need!

comment:3 Changed 15 years ago by (none)

Milestone: 1.2.2

Milestone 1.2.2 deleted

comment:4 Changed 14 years ago by paul

Milestone: 1.5
Note: See TracTickets for help on using tickets.