diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index 7f217dc..ac9ff3d 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -547,10 +547,7 @@ * form button that should be clicked. */ clickRemoveGroupButton: function (event) { - // For some reason, here we only need to trigger .submit(), unlike for - // Drupal.viewsUi.RearrangeFilterHandler.prototype.clickAddGroupButton() - // where we had to trigger .mousedown() also. - this.table.find('#' + event.data.buttonId).trigger('submit'); + this.table.find('input#' + event.data.buttonId).trigger('mousedown').trigger('submit'); event.preventDefault(); }, @@ -561,7 +558,11 @@ duplicateGroupsOperator: function () { var dropdowns, newRow, titleRow; - var titleRows = $('tr.views-group-title'); + var titleRows = $('tr.views-group-title').once('duplicateGroupsOperator'); + + if (!titleRows.length) { + return this.operator; + } // Get rid of the explanatory text around the operator; its placement is // explanatory enough. @@ -573,14 +574,6 @@ // Move the operator to a new row just above the second group. titleRow = $('tr#views-group-title-2'); - this.operator.find('label').add('div.description').addClass('visually-hidden'); - this.operator.find('select').addClass('form-select'); - - // Keep a list of the operator dropdowns, so we can sync their behavior later. - dropdowns = this.operator; - - // Move the operator to a new row just above the second group. - titleRow = $('tr#views-group-title-2'); newRow = $(''); newRow.find('td').append(this.operator); newRow.insertBefore(titleRow); diff --git a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php index 91e174f..a17d361 100644 --- a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php +++ b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php @@ -135,6 +135,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { 'class' => array('views-remove-group'), ), '#group' => $id, + '#ajax' => array( + 'path' => $this->getRequest()->getRequestUri(), + ) ); } $group_options[$id] = $id == 1 ? $this->t('Default group') : $this->t('Group @group', array('@group' => $id));