Skip to main content

Bug Tracker

Side navigation

#2927 closed enhancement (worksforme)

Opened May 23, 2008 11:44AM UTC

Closed May 23, 2008 06:01PM UTC

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@narrowstep.com
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.

Attachments (0)
Change History (2)

Changed May 23, 2008 04:10PM UTC by flesler comment:1

component: coreui
keywords: → droppable
owner: → paul

Changed May 23, 2008 06:01PM UTC by scott.gonzal comment:2

resolution: → worksforme
status: newclosed

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