diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-14 15:17:20 -0500 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-14 15:17:20 -0500 |
commit | 74b7b4466c62a18d6140b273208d5d332602410a (patch) | |
tree | 68f19f1f9646487dcd530e76115dec77e4ca9e9c /modules/simpletest/tests/ajax_forms_test.module | |
parent | 936c3331c155103875d2f4b3fb80785b366d0d6e (diff) | |
download | brdo-74b7b4466c62a18d6140b273208d5d332602410a.tar.gz brdo-74b7b4466c62a18d6140b273208d5d332602410a.tar.bz2 |
Issue #1287368 by TwoD, valthebald, sun, xjm: Fixed Drupal.settings.ajaxPageState.css gets overwritten.
Diffstat (limited to 'modules/simpletest/tests/ajax_forms_test.module')
-rw-r--r-- | modules/simpletest/tests/ajax_forms_test.module | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/simpletest/tests/ajax_forms_test.module b/modules/simpletest/tests/ajax_forms_test.module index 075b005ea..6a95710a8 100644 --- a/modules/simpletest/tests/ajax_forms_test.module +++ b/modules/simpletest/tests/ajax_forms_test.module @@ -468,6 +468,10 @@ function ajax_forms_test_validation_form_callback($form, $form_state) { * Form builder: Builds a form that triggers a simple AJAX callback. */ function ajax_forms_test_lazy_load_form($form, &$form_state) { + $form['add_files'] = array( + '#type' => 'checkbox', + '#default_value' => FALSE, + ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Submit'), @@ -482,9 +486,11 @@ function ajax_forms_test_lazy_load_form($form, &$form_state) { * Form submit handler: Adds JavaScript and CSS that wasn't on the original form. */ function ajax_forms_test_lazy_load_form_submit($form, &$form_state) { - drupal_add_js(array('ajax_forms_test_lazy_load_form_submit' => 'executed'), 'setting'); - drupal_add_css(drupal_get_path('module', 'system') . '/system.admin.css'); - drupal_add_js(drupal_get_path('module', 'system') . '/system.js'); + if ($form_state['values']['add_files']) { + drupal_add_js(array('ajax_forms_test_lazy_load_form_submit' => 'executed'), 'setting'); + drupal_add_css(drupal_get_path('module', 'system') . '/system.admin.css'); + drupal_add_js(drupal_get_path('module', 'system') . '/system.js'); + } $form_state['rebuild'] = TRUE; } |