[Seaside] JQDroppable convience method

Johan Brichau johan.brichau at uclouvain.be
Tue Oct 27 23:04:59 UTC 2009


Hi Lukas,

That's right but $(this) is bound to the droppable, while it's often  
convenient to get the object that was dragged onto it (the draggable).
Using the trigger:passengers: approach, it seems impossible to me to  
get to the draggable.

Or am I missing something?

On 27 Oct 2009, at 23:31, Lukas Renggli wrote:

> I typically do something along the lines of:
>
>    ... onDrop: (html jQuery ajax
>       tigger: [ :object | ... ] passengers: html jQuery this)
>
> The method #trigger:passengers: takes a block that is evaluated with a
> collection of passengers from the query passed in as the second
> argument.
>
> Lukas
>
> 2009/10/27 Johan Brichau <johan.brichau at uclouvain.be>:
>> Hi,
>>
>> While working with JQuery's draggable/droppable plugins in Seaside,  
>> I was
>> missing the convenient "passenger callbacks" that Scriptaculous had.
>> Therefore I added the following convenience method to JQDroppable.  
>> You can
>> pass it a block that will be invoked with the passenger of the  
>> draggable
>> that was dropped onto it.
>>
>> Would it make sense to add it to the plugin's distributed version?
>> And if I am making things overly complicated, that would be glad to  
>> know as
>> well ;-)
>>
>> cheers,
>>
>> onDropCallback: aBlock
>>        self onDrop:
>>                (((JQueryClass context: self renderContext) ajax
>>                                callback: [:value | aBlock value:  
>> (self
>> renderContext callbacks passengerAt: value)]
>>                                value: (JSStream on:
>> '$(ui.draggable).get(0).id'))
>>                        asFunction: #(event ui))
>>
>> ----------------------------
>> Johan Brichau
>> johan.brichau at uclouvain.be
>>
>>
>>
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
>
>
> -- 
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

----------------------------
Johan Brichau
johan.brichau at uclouvain.be






More information about the seaside mailing list