Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#2122 closed bug (fixed)

Droppable/Draggable element comparison needs to be changed on trunk.

Reported by: mnichols Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core Version: 1.2.1
Keywords: droppable trunk Cc:
Blocked by: Blocking:

Description

Since the rewrite on droppable.js in the trunk, the comparisons within the droppable methods over,out, and drop need to be changed . The component now lets you drop a draggable that is the same element. Please see attached patch. Also note that this patch contains the fixes in #2063 where the ui object is passed to the accept function on droppable.

Attachments (1)

uidroppable-fix_element_comparer_and_accept_fn.patch (2.8 KB) - added by mnichols 15 years ago.
This patch fixes element comparisons on droppable in the trunk and also extends the accept function argument

Download all attachments as: .zip

Change History (5)

Changed 15 years ago by mnichols

This patch fixes element comparisons on droppable in the trunk and also extends the accept function argument

comment:1 Changed 15 years ago by mnichols

note that using the patch I attached here, the following is possible in the droppable's accept function:

function tryAccept(ui){

console.debug('draggable:' + ui.draggable); console.debug('droppable:' + ui.instance); console.debug('droppable element:' + $j(ui.instance.element).attr('id')); console.debug('draggable element:' + $j(ui.element).attr('id'));

return true;

}

This let's the developer do runtime checks on the target droppable to see if an draggable element should be accepted or not. The current args do not allow this easily.

comment:2 Changed 15 years ago by paul

Resolution: fixed
Status: newclosed

Fixed ('this' now links to the current droppable, first argument is the draggable)

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.