Commit 4988a81a authored by alexpott's avatar alexpott

Issue #2024695 by olli, SpadXIII: The "Reset" button ignores the "Use AJAX"...

Issue #2024695 by olli, SpadXIII: The "Reset" button ignores the "Use AJAX" setting (always behaves in a non-AJAX way)
parent 1a0cdcd3
......@@ -108,14 +108,15 @@
* @method
*/
Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () {
var button = $('input[type=submit], input[type=image]', this.$exposed_form);
button = button[0];
var self_settings = $.extend({}, this.element_settings, {
base: $(button).attr('id'),
element: button
var that = this;
this.exposedFormAjax = [];
$('input[type=submit], input[type=image]', this.$exposed_form).each(function (index) {
var self_settings = $.extend({}, that.element_settings, {
base: $(this).attr('id'),
element: this
});
that.exposedFormAjax[index] = Drupal.ajax(self_settings);
});
this.exposedFormAjax = Drupal.ajax(self_settings);
};
/**
......
......@@ -321,7 +321,7 @@ public function resetForm(&$form, FormStateInterface $form_state) {
}
// Set the form to allow redirect.
if (empty($this->view->live_preview)) {
if (empty($this->view->live_preview) && !\Drupal::request()->isXmlHttpRequest()) {
$form_state->disableRedirect(FALSE);
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment