Index: ahah_forms.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ahah_forms/ahah_forms.module,v retrieving revision 1.1.2.14 diff -u -p -w -r1.1.2.14 ahah_forms.module --- ahah_forms.module 6 Apr 2007 08:27:25 -0000 1.1.2.14 +++ ahah_forms.module 12 Feb 2008 07:42:20 -0000 @@ -61,6 +61,8 @@ function ahah_forms_scan_form_children( function ahah_forms_bind_form( $form ) { $bindings = array(); + static $added_base_module_settings; + ahah_forms_scan_form_children( $form, $form['#id'], $bindings ); // drupal_set_message( "After Scan: Wrapper Bindings = " . dprint_r( $bindings, TRUE ) ); @@ -70,12 +72,23 @@ function ahah_forms_bind_form( $form ) { drupal_add_js("$module_path/lib/form.js"); // jquery plugin for easy ahah form submition drupal_add_js("$module_path/ahah_forms.js", 'module', 'footer'); // put in footer, so it can listen to other js files set bindings (kludgy) + // add basePaths and module only once + if (!$added_base_module_settings) { drupal_add_js( array( 'ahah' => array( - 'basePaths' => array( 'base' => base_path(), 'module' => $module_path ), - 'bindings' => array( $bindings ), + 'basePaths' => array( 'base' => base_path(), 'module' => $module_path ) + ), ), + 'setting' + ); + $added_base_module_settings = TRUE; + } + + // add specific binding for the given form + drupal_add_js( + array( + 'ahah' => array('bindings' => array( $bindings )), ), 'setting' );