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 @@ ...@@ -108,14 +108,15 @@
* @method * @method
*/ */
Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () { Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () {
var button = $('input[type=submit], input[type=image]', this.$exposed_form); var that = this;
button = button[0]; this.exposedFormAjax = [];
$('input[type=submit], input[type=image]', this.$exposed_form).each(function (index) {
var self_settings = $.extend({}, this.element_settings, { var self_settings = $.extend({}, that.element_settings, {
base: $(button).attr('id'), base: $(this).attr('id'),
element: button 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) { ...@@ -321,7 +321,7 @@ public function resetForm(&$form, FormStateInterface $form_state) {
} }
// Set the form to allow redirect. // 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); $form_state->disableRedirect(FALSE);
} }
else { 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