To avoid possible confusion, I'd recommend a different name for apply
(), as there's the JavaScript apply() method.
-thomas
Am 04.05.2007 um 08:51 schrieb Ben Nolan:
> I don't think the little snippet will do it.
>
> You want something like:
>
> Behaviour = {
> sheets_ : $A(),
> register : function(sheet){
> this.sheets_.push(sheet);
> },
> apply : function(){
> this.sheets_.each(** as above **);
> }
> }
>
> Ben
>
> On 5/4/07, chris <[EMAIL PROTECTED]> wrote:
>>
>> Would this solution be able to reapply the Behaviour rules to
>> elements
>> that are dynamically added to the page? Nolan's Behaviour.js has a
>> Behaviour.apply() function that does this.
>>
>> cheers, chris
>>
>> On May 3, 7:12 pm, "Mislav Marohnić" <[EMAIL PROTECTED]>
>> wrote:
>>> On 5/3/07, snarkyFish <[EMAIL PROTECTED]> wrote:
>>
>>> Once, when we (the core guys) chatted working on the event
>>> branch, I though
>>> of how easy it would be to re-implement Behaviour in Prototype:
>>>
>>> var Behaviour = {
>>> register: function(obj) {
>>> Event.onReady(function(){ for (sel in obj) $$(sel).each(obj
>>> [sel]) })
>>> }
>>>
>>> }
>>>
>>> Yeah, this is it. You only need Event.onReady() for this. You can
>>> find it in
>>> the event branch or you can copy it over from LowPro. Once
>>> Event.onReady()
>>> gets into trunk, these 3 lines will probably be all you need.
>>
>>
>>>
>>
>
>
> --
> Regards,
> Ben Nolan
>
> Moso Interactive
>
> skype: bennolan
> cell: +49 1577 383 7542
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---