diff --git a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php index 45b86be..4c25a8b 100644 --- a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php +++ b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php @@ -124,7 +124,6 @@ public function showExposeButton(&$form, FormStateInterface $form_state) { '#type' => 'submit', '#value' => $this->t('Expose sort'), '#submit' => array(array($this, 'displayExposedForm')), - '#attributes' => array('class' => array('use-ajax-submit')), ); $form['expose_button']['checkbox']['checkbox']['#default_value'] = 0; } @@ -137,10 +136,13 @@ public function showExposeButton(&$form, FormStateInterface $form_state) { '#type' => 'submit', '#value' => $this->t('Hide sort'), '#submit' => array(array($this, 'displayExposedForm')), - '#attributes' => array('class' => array('use-ajax-submit')), ); $form['expose_button']['checkbox']['checkbox']['#default_value'] = 1; } + if ($form_state->get('ajax')) { + $form['expose_button']['button']['#id'] = 'edit-options-expose-button-button'; + $form['expose_button']['button']['#ajax']['path'] = $form_state->get('path'); + } } /**