Bug Tracker

Opened 12 years ago

Closed 12 years ago

#2927 closed enhancement (worksforme)

Droppable accept option - allow a function

Reported by: pfm102 Owned by: paul
Priority: major Milestone: 1.3
Component: ui Version: 1.2.5
Keywords: droppable Cc: pmounce@…
Blocked by: Blocking:

Description

It would be great if the "accept" option to droppable could accept a function instead of a jQuery selector.

That function should have the event and UI arguments (same as drop option).

I want to be able to write quite complex logic for knowing whether the droppable should accept the draggable. For example, when re-ordering a list (where droppables are list-items with a class of "gap", interspersed with the content list-items), I would like to allow ul.gap to accept my draggable, UNLESS the gap is an immediate sibling of where the draggable started.

Change History (2)

comment:1 Changed 12 years ago by flesler

Component: coreui
Keywords: droppable added
Owner: set to paul

comment:2 Changed 12 years ago by scott.gonzal

Resolution: worksforme
Status: newclosed

The accept option already supports functions. The function takes one parameter which is the draggable element.

Note: See TracTickets for help on using tickets.