diff -u b/core/modules/editor/editor.module b/core/modules/editor/editor.module --- b/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -128,10 +128,24 @@ // but after the filter label and name (weight of -20). '#weight' => -9, '#ajax' => array( + 'trigger_as' => array('name' => 'editor_configure'), 'callback' => 'editor_form_filter_admin_form_ajax', 'wrapper' => 'editor-settings-wrapper', ), ); + $form['editor_configure'] = array( + '#type' => 'submit', + '#name' => 'editor_configure', + '#value' => t('Configure'), + '#limit_validation_errors' => array(array('editor')), + '#submit' => array('editor_form_filter_admin_format_editor_configure'), + '#ajax' => array( + 'callback' => 'editor_form_filter_admin_form_ajax', + 'wrapper' => 'editor-settings-wrapper', + ), + '#weight' => -9, + '#attributes' => array('class' => array('js-hide')), + ); // If there aren't any options (other than "None"), disable the select list. if (empty($editor_options)) { @@ -158,9 +172,9 @@ } /** - * AJAX callback handler for filter_admin_format_form(). + * Button submit handler for filter_admin_format_form()'s 'editor_configure' button. */ -function editor_form_filter_admin_form_ajax($form, &$form_state) { +function editor_form_filter_admin_format_editor_configure($form, &$form_state) { $editor = $form_state['editor']; if (isset($form_state['values']['editor'])) { if ($form_state['values']['editor'] === '') { @@ -176,10 +190,13 @@ $form_state['editor'] = $editor; } } + $form_state['rebuild'] = TRUE; +} - // Process the form again, so that $form['editor_settings'] is updated. - drupal_process_form($form['#form_id'], $form, $form_state); - +/** + * AJAX callback handler for filter_admin_format_form(). + */ +function editor_form_filter_admin_form_ajax($form, &$form_state) { return $form['editor_settings']; }