diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/field/field.form.inc | 1 | ||||
-rw-r--r-- | modules/file/file.module | 1 | ||||
-rw-r--r-- | modules/poll/poll.module | 1 | ||||
-rw-r--r-- | modules/simpletest/tests/ajax.test | 5 | ||||
-rw-r--r-- | modules/simpletest/tests/ajax_forms_test.module | 20 |
5 files changed, 25 insertions, 3 deletions
diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc index 5fd367a07..61a5833bc 100644 --- a/modules/field/field.form.inc +++ b/modules/field/field.form.inc @@ -215,7 +215,6 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form, '#ajax' => array( 'callback' => 'field_add_more_js', 'wrapper' => $wrapper_id, - 'method' => 'replace', 'effect' => 'fade', ), // The field_add_more_submit() and field_add_more_js() handlers will diff --git a/modules/file/file.module b/modules/file/file.module index b925d7c2e..44ef83c06 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -351,7 +351,6 @@ function file_managed_file_process($element, &$form_state, $form) { $ajax_settings = array( 'path' => 'file/ajax/' . implode('/', $element['#parents']) . '/' . $form['form_build_id']['#value'], 'wrapper' => $element['#id'] . '-ajax-wrapper', - 'method' => 'replace', 'effect' => 'fade', 'progress' => array( 'type' => $element['#progress_indicator'], diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 729a51dc9..f7eb9ebaa 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -297,7 +297,6 @@ function poll_form($node, &$form_state) { '#ajax' => array( 'callback' => 'poll_choice_js', 'wrapper' => 'poll-choices', - 'method' => 'replace', 'effect' => 'fade', ), ); diff --git a/modules/simpletest/tests/ajax.test b/modules/simpletest/tests/ajax.test index 80ea29f58..97cd2f5d2 100644 --- a/modules/simpletest/tests/ajax.test +++ b/modules/simpletest/tests/ajax.test @@ -146,6 +146,11 @@ class AJAXCommandsTestCase extends AJAXTestCase { $command = $commands[0]; $this->assertTrue($command['command'] == 'insert' && $command['method'] == 'html' && $command['data'] == 'replacement text', "'html' AJAX command issued with correct data"); + // Tests the 'insert' command. + $commands = $this->discardSettings($this->drupalPostAJAX($form_path, $edit, array('op' => t("AJAX insert: Let client insert based on #ajax['method'].")))); + $command = $commands[0]; + $this->assertTrue($command['command'] == 'insert' && $command['method'] == NULL && $command['data'] == 'insert replacement text', "'insert' AJAX command issued with correct data"); + // Tests the 'prepend' command. $commands = $this->discardSettings($this->drupalPostAJAX($form_path, $edit, array('op' => t("AJAX 'prepend': Click to prepend something")))); $command = $commands[0]; diff --git a/modules/simpletest/tests/ajax_forms_test.module b/modules/simpletest/tests/ajax_forms_test.module index 5de2b842c..db8aa3b92 100644 --- a/modules/simpletest/tests/ajax_forms_test.module +++ b/modules/simpletest/tests/ajax_forms_test.module @@ -186,6 +186,17 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '<div id="html_div">Original contents</div>', ); + // Shows the AJAX 'insert' command. + $form['insert_command_example'] = array( + '#value' => t("AJAX insert: Let client insert based on #ajax['method']."), + '#type' => 'submit', + '#ajax' => array( + 'callback' => 'ajax_forms_test_advanced_commands_insert_callback', + 'method' => 'prepend', + ), + '#suffix' => '<div id="insert_div">Original contents</div>', + ); + // Shows the AJAX 'prepend' command. $form['prepend_command_example'] = array( '#value' => t("AJAX 'prepend': Click to prepend something"), @@ -321,6 +332,15 @@ function ajax_forms_test_advanced_commands_html_callback($form, $form_state) { } /** + * AJAX callback for 'insert'. + */ +function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) { + $commands = array(); + $commands[] = ajax_command_insert('#insert_div', 'insert replacement text'); + return array('#type' => 'ajax', '#commands' => $commands); +} + +/** * AJAX callback for 'prepend'. */ function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state) { |