Opened 15 years ago
Closed 12 years ago
#2063 closed enhancement (invalid)
Droppable accept function improvement
Reported by: | mnichols | Owned by: | rworth |
---|---|---|---|
Priority: | major | Milestone: | 1.2.2 |
Component: | ui | Version: | 1.2.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I am commonly needing to get the droppable element being targeted during an 'accept' callback to determine if the draggable signature is acceptable against the droppable element. There isn't an easy way to get the droppable instance during this callback, so I changed draggable and droppable to use 'call' while passing in the droppable instance to force 'this' to always be the droppable being targeted during the accept callback. Really, the 'ui' object should be getting passed in to this callback just like the other options to be consistent. Please see attached patches or consider changing the method signature of this callback ... the function callback seems to have been an afterthought.
Attachments (4)
Change History (13)
Changed 15 years ago by
Attachment: | uidraggable121607.patch added |
---|
Changed 15 years ago by
Attachment: | uidroppable121607.patch added |
---|
Droppable invoking using 'call' on accept callback
comment:1 Changed 15 years ago by
My draggable patch has a small error...it is passing the draggable instead of the draggable.element as other parts do. Really, the documentation is wrong when it says that the draggable is passed to the accept callback since in fact the draggable.element is being passed.
comment:2 Changed 15 years ago by
Owner: | set to rworth |
---|---|
Status: | new → assigned |
Changed 15 years ago by
Attachment: | uidroppable-pass.ui.to.accept.patch added |
---|
Patch successfully passes ui to the accept function of droppable
comment:3 Changed 15 years ago by
Due to the complete rewrite of droppables recently, the first two patches are stale. I have created a new patch that allows passing the 'ui' object from droppable into the accept function. This gives developer better options for determining if an draggable should be accepted based on criteria found in the target droppable.
Please see attached ' uidroppable-pass.ui.to.accept.patch ' and disregard the previous patches....
Mike
comment:4 Changed 15 years ago by
I submitted #2122 that has this patch and a fix to the most recent trunk. I'd recommend disregarding this patch to get the fix.
Mike
comment:5 Changed 15 years ago by
I think the above patch is a more elegant approach to passing the ui object as this
to the accept function
comment:7 Changed 15 years ago by
it's made against r4501, should apply cleanly to current trunk (the changes that have occurred since then are fn API changes, the ui part is unchanged)
comment:8 Changed 15 years ago by
If I understand your patch, it seems your patch is passing the droppable (not ui) to be this
.
The patch I submitted in #2122 passes the ui object as an arg the same as the other method calls. This is more intuitive I think than requiring the dev to back into the ui
object thru this
.
comment:11 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
UI bugs should be reported to: http://dev.jqueryui.com/
Draggable using 'call' for accept callback