Posted by donquixote on October 7, 2011 at 5:02am
This module's API allows to set weights for behaviors attached via Drupal.behaviors.
See How can I control the order of Drupal.behaviors? (on stackoverflow).
You will only need this module if you either want to use it in your own code, or if another module depends on it.
API Usage (D6)
(function(){
// Let this run before other behaviors (default weight is 0)
Drupal.behaviors['mymodule_early.weight'] = -10;
// Now define the behavior itself.
Drupal.behaviors.mymodule_early = function(context){
.. // your stuff to happen.
};
})();API Usage (D7)
(function(){
Drupal.behaviors.mymodule_early = {attach: function(context){..}};
// Let this run before other behaviors (default weight is 0)
Drupal.behaviors['mymodule_early.weight'] = -7;
// Alternative way to set the weight. This has a lower priority than the above.
Drupal.behaviors.mymodule_early.weight = -9;
// The weight will be -7, because the ['..'] syntax has higher priority.
})();Looking for Co-Maintainer
This is never going to be a big module, but nevertheless it could be helpful to have someone else in the boat, if only as a critical voice!
Downloads
Recommended releases
Development releases
Project Information
- Maintenance status: Seeking co-maintainer(s)
- Development status: Under active development
- Reported installs: 11 sites currently report using this module. View usage statistics.
- Downloads: 173
- Last modified: May 13, 2012