« Return to Thread: behaviors context

Re: behaviors context

by Matt-192 :: Rate this Message:

Reply to Author | View in Thread

Thus my original claim: You are at the mercy of whatever calls
Drupal.attachBehaviors(). Unless you are absolutely positive you can
account for all use cases (and thus all callings of Drupal.attach()),
you're better off ignoring context.

Matt

On Fri, May 29, 2009 at 1:04 PM, Daniel F. Kudwien
<news@...> wrote:

>> The context is supposed to be the element to be
>> processed--not a jQuery object but the page element. See the
>> 5 - 6 upgrade notes:
>> http://drupal.org/node/114774#javascript-behaviors
>>
>> However, this fact may have been lost along the way.
>
> Note that even misc/ahah.js passes an jQuery object:
>
>  if (new_content.parents('html').length > 0) {
>    Drupal.attachBehaviors(new_content);
>  }
>
>
> However, passing a string as context sounds a bit wrong.  Behaviors usually
> expect a DOM element.
>
> sun
>
>



--
http://technosophos.com
http://querypath.org

 « Return to Thread: behaviors context