Patch attached changes "release/project_release.js" functions to be included with Drupal.behaviors and no more doc.ready logic. Untested, needs review.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Patches apply are against aclight's SYN.

hass’s picture

Status: Active » Needs review
aclight’s picture

Status: Needs review » Needs work

As per http://drupal.org/node/114774#javascript-behaviors I believe that something needs to be changed near where we use .each.

The upgrade docs give the following example:
Old code:

Drupal.myBehaviorAttach = function () {
  $('.my-class').each(function () {
    // Process...
  });
}

if (Drupal.jsEnabled) {
  $(document).ready(Drupal.myBehaviorAttach);
}

New code:

Drupal.behaviors.myBehavior = function (context) {
  $('.my-class:not(.myBehavior-processed)', context).addClass('myBehavior-processed').each(function () {
    // Process...
  });
};
hass’s picture

I've stolen this from OG... and therefore it seems to be ok. We are not using each in the old code and therefore we don't use it in new code...

hass’s picture

hass’s picture

I've also checked the same change in Google Analytics 6.x-2.x and it seems working well.

dww’s picture

Version: x.y.z » 6.x-1.x-dev
Category: bug » task
hass’s picture

Patch against CVS without local windows paths for easier patching. No changes.

dww’s picture

Status: Needs review » Needs work

Committed #8 to HEAD since that part is fine and working. However, project_release.js does use .each(), and it seems like what aclight pointed out in #3 is still applicable.

hass’s picture

I've only upgraded the outdated $(document).ready(Drupal.projectReleaseAutoAttach); on doc ready to the new logic. As we are only changing one element we don't need to "each" something else... !?