diff --git a/privatemsg-list.js b/privatemsg-list.js index 9e025347f245bd28330131bae204c915b2435901..66f36b67f3fd277e1764b2cf7fcec5ee88563ea9 100644 --- a/privatemsg-list.js +++ b/privatemsg-list.js @@ -1,3 +1,7 @@ -Drupal.behaviors.hideButtons = function (context) { - $("input.privatemsg-action-button").hide(); -}; \ No newline at end of file +Drupal.behaviors.actionButtons = function (context) { + $("div.privatemsg-op-button").hide(); + + $('#privatemsg-list #edit-operation').change(function () { + $('#edit-submit').click(); + }); +}; diff --git a/privatemsg.module b/privatemsg.module index 1628d2eeac4d4a06e28e0aa783a92245b31acd57..5ab66a20fcaa71c143f11811a717f70113a3c648 100644 --- a/privatemsg.module +++ b/privatemsg.module @@ -2107,16 +2107,16 @@ function _privatemsg_action_form() { '#type' => 'select', '#options' => $options, '#default_value' => 0, - // Execute the submit button if a operation has been selected. - '#attributes' => array('onchange' => "$('#edit-submit').click()"), ); $form['submit'] = array( + '#prefix' => '
', + '#suffix' => '
', '#type' => 'submit', '#value' => t('Execute'), '#submit' => array('privatemsg_list_submit'), '#attributes' => array('class' => 'privatemsg-action-button'), ); - // JS for hiding the execute button(s) + // JS for hiding the execute button. drupal_add_js(drupal_get_path('module', 'privatemsg') .'/privatemsg-list.js'); return $form; } diff --git a/privatemsg_filter/privatemsg_filter.module b/privatemsg_filter/privatemsg_filter.module index d088800201aa1b32d1a374cb61f753fbe8626a3a..5b40f5e5b15c7d703dc4fa4469b58386d59ad4d6 100644 --- a/privatemsg_filter/privatemsg_filter.module +++ b/privatemsg_filter/privatemsg_filter.module @@ -511,29 +511,32 @@ function privatemsg_filter_form_privatemsg_list_alter(&$form, $form_state) { '#type' => 'select', '#options' => $options, '#default_value' => 0, - // Execute the submit button if a operation has been selected. - '#attributes' => array('onchange' => "$('#edit-tag-add-submit').click()"), ); $form['actions']['tag-add-submit'] = array( + '#prefix' => '
', + '#suffix' => '
', '#type' => 'submit', - '#value' => t('Apply tag'), + '#value' => t('Apply Tag'), '#submit' => array('privatemsg_filter_add_tag_submit'), '#attributes' => array('class' => 'privatemsg-action-button'), ); - $options[0] = t('Remove tag...'); + $options[0] = t('Remove Tag...'); $form['actions']['tag-remove'] = array( '#type' => 'select', '#options' => $options, '#default_value' => 0, - // Execute the submit button if a operation has been selected. - '#attributes' => array('onchange' => "$('#edit-tag-remove-submit').click()"), ); $form['actions']['tag-remove-submit'] = array( + '#prefix' => '
', + '#suffix' => '
', '#type' => 'submit', - '#value' => t('Remove tag'), + '#value' => t('Remove Tag'), '#submit' => array('privatemsg_filter_remove_tag_submit'), '#attributes' => array('class' => 'privatemsg-action-button'), ); + + // JS for hiding the submit buttons. + drupal_add_js(drupal_get_path('module', 'privatemsg_filter') .'/privatemsg-filter-list.js'); } }