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 = $('