[development] behaviors context

Matt matt at aleph-null.tv
Fri May 29 18:14:21 UTC 2009


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 at unleashedmind.com> 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


More information about the development mailing list