diff options
Diffstat (limited to 'misc/ahah.js')
-rw-r--r-- | misc/ahah.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/misc/ahah.js b/misc/ahah.js index a098addb9..ca5580a46 100644 --- a/misc/ahah.js +++ b/misc/ahah.js @@ -15,17 +15,19 @@ /** * Attaches the ahah behavior to each ahah form element. */ -Drupal.behaviors.ahah = function(context) { - for (var base in Drupal.settings.ahah) { - if (!$('#'+ base + '.ahah-processed').size()) { - var element_settings = Drupal.settings.ahah[base]; - - $(element_settings.selector).each(function() { - element_settings.element = this; - var ahah = new Drupal.ahah(base, element_settings); - }); - - $('#'+ base).addClass('ahah-processed'); +Drupal.behaviors.ahah = { + attach: function(context) { + for (var base in Drupal.settings.ahah) { + if (!$('#'+ base + '.ahah-processed').size()) { + var element_settings = Drupal.settings.ahah[base]; + + $(element_settings.selector).each(function() { + element_settings.element = this; + var ahah = new Drupal.ahah(base, element_settings); + }); + + $('#'+ base).addClass('ahah-processed'); + } } } }; |