From 5efa7d55cad7751eb6d66395d0869daeba8b5d52 Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Mon, 31 Mar 2014 08:27:18 -0700
Subject: [PATCH] Issue #2130205 by damiankloip, rbayliss, olli: Unable to
 "Expose this filter to visitors, to allow them to change it".

---
 .../Drupal/views/Plugin/views/filter/FilterPluginBase.php    | 5 +++++
 .../lib/Drupal/views/Plugin/views/sort/SortPluginBase.php    | 2 ++
 core/modules/views_ui/js/views-admin.js                      | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
index 042b8a0acbf0..eb0271a6e8df 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
@@ -399,6 +399,7 @@ protected function showBuildGroupButton(&$form, &$form_state) {
         '#type' => 'submit',
         '#value' => t('Grouped filters'),
         '#submit' => array(array($this, 'buildGroupForm')),
+        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['group_button']['radios']['radios']['#default_value'] = 0;
     }
@@ -408,6 +409,7 @@ protected function showBuildGroupButton(&$form, &$form_state) {
         '#type' => 'submit',
         '#value' => t('Single filter'),
         '#submit' => array(array($this, 'buildGroupForm')),
+        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['group_button']['radios']['radios']['#default_value'] = 1;
     }
@@ -468,6 +470,7 @@ public function showExposeButton(&$form, &$form_state) {
         '#type' => 'submit',
         '#value' => t('Expose filter'),
         '#submit' => array(array($this, 'displayExposedForm')),
+        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['expose_button']['checkbox']['checkbox']['#default_value'] = 0;
     }
@@ -480,6 +483,7 @@ public function showExposeButton(&$form, &$form_state) {
         '#type' => 'submit',
         '#value' => t('Hide filter'),
         '#submit' => array(array($this, 'displayExposedForm')),
+        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['expose_button']['checkbox']['checkbox']['#default_value'] = 1;
     }
@@ -1061,6 +1065,7 @@ protected function buildExposedFiltersGroupForm(&$form, &$form_state) {
       '#type' => 'submit',
       '#value' => t('Add another item'),
       '#submit' => array(array($this, 'addGroupForm')),
+      '#attributes' => array('class' => array('use-ajax-submit')),
     );
 
     $js = array();
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php
index 3273b2b18b91..74c9710c58c1 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php
@@ -117,6 +117,7 @@ public function showExposeButton(&$form, &$form_state) {
         '#type' => 'submit',
         '#value' => t('Expose sort'),
         '#submit' => array(array($this, 'displayExposedForm')),
+        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['expose_button']['checkbox']['checkbox']['#default_value'] = 0;
     }
@@ -129,6 +130,7 @@ public function showExposeButton(&$form, &$form_state) {
         '#type' => 'submit',
         '#value' => t('Hide sort'),
         '#submit' => array(array($this, 'displayExposedForm')),
+        '#attributes' => array('class' => array('use-ajax-submit')),
       );
       $form['expose_button']['checkbox']['checkbox']['#default_value'] = 1;
     }
diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js
index d0204e6d1cf6..c423c09fb6f7 100644
--- a/core/modules/views_ui/js/views-admin.js
+++ b/core/modules/views_ui/js/views-admin.js
@@ -861,7 +861,7 @@
    */
   Drupal.viewsUi.Checkboxifier.prototype.clickHandler = function (e) {
     this.$button
-      .trigger('mousedown')
+      .trigger('click')
       .trigger('submit');
   };
 
-- 
GitLab