diff --git a/core/assets/vendor/jquery.ui/ui/jquery-ui.custom.js b/core/assets/vendor/jquery.ui/ui/jquery-ui.custom.js index 915edc8..37b96db 100644 --- a/core/assets/vendor/jquery.ui/ui/jquery-ui.custom.js +++ b/core/assets/vendor/jquery.ui/ui/jquery-ui.custom.js @@ -5756,7 +5756,7 @@ $.widget( "ui.dialog", { // the .ui-front logic (#8989) !$( event.target ).closest(".ui-datepicker").length ) { event.preventDefault(); - $(".ui-dialog").filter(":visible:last").find(".ui-dialog-content") + $(".ui-dialog:visible:last .ui-dialog-content") .data("ui-dialog")._focusTabbable(); } }); @@ -9719,7 +9719,7 @@ $.widget( "ui.menu", { this.active .parent() .closest( ".ui-menu-item" ) - .children( "a" ).filter( ":first" ) + .children( "a:first" ) .addClass( "ui-state-active" ); if ( event && event.type === "keydown" ) { diff --git a/core/assets/vendor/jquery.ui/ui/jquery.ui.dialog.js b/core/assets/vendor/jquery.ui/ui/jquery.ui.dialog.js index 589e85d..b2df1a7 100644 --- a/core/assets/vendor/jquery.ui/ui/jquery.ui.dialog.js +++ b/core/assets/vendor/jquery.ui/ui/jquery.ui.dialog.js @@ -719,7 +719,7 @@ $.widget( "ui.dialog", { this.document.bind( "focusin.dialog", function( event ) { if ( !that._allowInteraction( event ) ) { event.preventDefault(); - $(".ui-dialog").filter(":visible:last").find(".ui-dialog-content") + $(".ui-dialog:visible:last .ui-dialog-content") .data( widgetFullName )._focusTabbable(); } }); diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index 5f110b1..fc9927f 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -157,7 +157,7 @@ Drupal.tableDrag.prototype.initColumns = function () { if (this.tableSettings.hasOwnProperty(group)) { // Find the first field in this group. for (var d in this.tableSettings[group]) { if (this.tableSettings[group].hasOwnProperty(d)) { - var field = $table.find('.' + this.tableSettings[group][d].target).filter(':first'); + var field = $table.find('.' + this.tableSettings[group][d].target).first(); if (field.length && this.tableSettings[group][d].hidden) { hidden = this.tableSettings[group][d].hidden; cell = field.closest('td'); @@ -310,18 +310,18 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { var self = this; var $item = $(item); //Add a class to the title link - $item.find('td').eq(0).find('a').addClass('menu-item__link'); + $item.find('td a').first().addClass('menu-item__link'); // Create the handle. var handle = $('
 
').attr('title', Drupal.t('Drag to re-order')); // Insert the handle after indentations (if any). - var $indentationLast = $item.find('td').eq(0).find('.indentation').filter(':last'); + var $indentationLast = $item.find('td .indentation').last(); if ($indentationLast.length) { $indentationLast.after(handle); // Update the total width of indentation in this entire table. self.indentCount = Math.max($item.find('.indentation').length, self.indentCount); } else { - $item.find('td').eq(0).prepend(handle); + $item.find('td').first().prepend(handle); } if (Modernizr.touch) { @@ -416,7 +416,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { break; case 40: // Down arrow. case 63233: // Safari down arrow. - var $nextRow = $(self.rowObject.group).filter(':last').next('tr').eq(0); + var $nextRow = $(self.rowObject.group).last().next('tr').eq(0); var nextRow = $nextRow.get(0); while (nextRow && $nextRow.is(':hidden')) { $nextRow = $(nextRow).next('tr').eq(0); @@ -435,7 +435,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { $(nextGroup.group).each(function () { groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight; }); - var nextGroupRow = $(nextGroup.group).filter(':last').get(0); + var nextGroupRow = $(nextGroup.group).last().get(0); self.rowObject.swap('after', nextGroupRow); // No need to check for indentation, 0 is the only valid one. window.scrollBy(0, parseInt(groupHeight, 10)); @@ -803,7 +803,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) { // Use the first row in the table as source, because it's guaranteed to // be at the root level. Find the first item, then compare this row // against it as a sibling. - sourceRow = $(this.table).find('tr.draggable.eq(0).get(0); + sourceRow = $(this.table).find('tr.draggable').first().get(0); if (sourceRow === this.rowObject.element) { sourceRow = $(this.rowObject.group[this.rowObject.group.length - 1]).next('tr.draggable').get(0); } @@ -1128,7 +1128,7 @@ Drupal.tableDrag.prototype.row.prototype.indent = function (indentDiff) { // Determine the valid indentations interval if not available yet. if (!this.interval) { var prevRow = $(this.element).prev('tr').get(0); - var nextRow = $group.filter(':last').next('tr').get(0); + var nextRow = $group.last().next('tr').get(0); this.interval = this.validIndentInterval(prevRow, nextRow); } @@ -1141,11 +1141,11 @@ Drupal.tableDrag.prototype.row.prototype.indent = function (indentDiff) { for (var n = 1; n <= Math.abs(indentDiff); n++) { // Add or remove indentations. if (indentDiff < 0) { - $group.find('.indentation').eq(0).remove(); + $group.find('.indentation').first().remove(); this.indents--; } else { - $group.find('td').eq(0).prepend(Drupal.theme('tableDragIndentation')); + $group.find('td:first').prepend(Drupal.theme('tableDragIndentation')); this.indents++; } } @@ -1225,7 +1225,7 @@ Drupal.tableDrag.prototype.row.prototype.removeIndentClasses = function () { */ Drupal.tableDrag.prototype.row.prototype.markChanged = function () { var marker = Drupal.theme('tableDragChangedMarker'); - var cell = $(this.element).find('td').eq(0); + var cell = $(this.element).find('td').first(); if (cell.find('abbr.tabledrag-changed').length === 0) { cell.append(marker); } diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js index b8bc996..f579812 100644 --- a/core/misc/vertical-tabs.js +++ b/core/misc/vertical-tabs.js @@ -55,8 +55,8 @@ Drupal.behaviors.verticalTabs = { } }); - $(tab_list).find('> li').eq(0).addClass('first'); - $(tab_list).find('> li').filter(':last').addClass('last'); + $(tab_list).find('> li').first().addClass('first'); + $(tab_list).find('> li').last().addClass('last'); if (!tab_focus) { // If the current URL has a fragment and one of the tabs contains an @@ -66,7 +66,7 @@ Drupal.behaviors.verticalTabs = { tab_focus = $locationHash.closest('.vertical-tabs-pane'); } else { - tab_focus = $this.find('> .vertical-tabs-pane').eq(0); + tab_focus = $this.find('> .vertical-tabs-pane').first(); } } if (tab_focus.length) { @@ -102,7 +102,7 @@ Drupal.verticalTab = function (settings) { if (event.keyCode === 13) { self.focus(); // Set focus on the first input field of the visible details/tab pane. - $(".vertical-tabs-pane").find("input,button,textarea,select").filter(":visible:enabled:first").trigger('focus'); + $('.vertical-tabs-pane').find('input,button,textarea,select').filter(':visible:enabled').first().trigger('focus'); } }); @@ -154,7 +154,7 @@ Drupal.verticalTab.prototype = { // actual DOM element order as jQuery implements sortOrder, but not as public // method. this.item.parent().children('.vertical-tab-button').removeClass('first') - .filter(':visible:first').addClass('first'); + .filter(':visible').first().addClass('first'); // Display the details element. this.details.removeClass('vertical-tab-hidden').show(); // Focus this tab. @@ -172,11 +172,11 @@ Drupal.verticalTab.prototype = { // actual DOM element order as jQuery implements sortOrder, but not as public // method. this.item.parent().children('.vertical-tab-button').removeClass('first') - .filter(':visible:first').addClass('first'); + .filter(':visible').first().addClass('first'); // Hide the details element. this.details.addClass('vertical-tab-hidden').hide(); // Focus the first visible tab (if there is one). - var $firstTab = this.details.siblings('.vertical-tabs-pane').not('.vertical-tab-hidden').filter(':first'); + var $firstTab = this.details.siblings('.vertical-tabs-pane').not('.vertical-tab-hidden').first(); if ($firstTab.length) { $firstTab.data('verticalTab').focus(); } diff --git a/core/modules/contextual/js/contextual.js b/core/modules/contextual/js/contextual.js index affab88..44840e3 100644 --- a/core/modules/contextual/js/contextual.js +++ b/core/modules/contextual/js/contextual.js @@ -37,7 +37,7 @@ function initContextual ($contextual) { // Create a model and the appropriate views. var model = new contextual.Model({ - title: $region.find('h2').eq(0).text().trim() + title: $region.find('h2').first().text().trim() }); var viewOptions = $.extend({ el: $contextual, model: model }, options); contextual.views.push({ @@ -292,7 +292,7 @@ Drupal.contextual = { // Nested contextual region handling: hide any nested contextual triggers. if ('isOpen' in this.model.changed) { this.$el.closest('.contextual-region') - .find('.contextual .trigger').not('first') + .find('.contextual .trigger').not(':first') .toggle(!isOpen); } diff --git a/core/modules/editor/js/editor.formattedTextEditor.js b/core/modules/editor/js/editor.formattedTextEditor.js index 0db5704..4747a02 100644 --- a/core/modules/editor/js/editor.formattedTextEditor.js +++ b/core/modules/editor/js/editor.formattedTextEditor.js @@ -41,7 +41,7 @@ Drupal.edit.editors.editor = Drupal.edit.EditorView.extend({ // Store the actual value of this field. We'll need this to restore the // original value when the user discards his modifications. - this.$textElement = this.$el.find('.field-item').eq(0); + this.$textElement = this.$el.find('.field-item').first(); this.model.set('originalValue', this.$textElement.html()); }, diff --git a/core/modules/shortcut/shortcut.admin.js b/core/modules/shortcut/shortcut.admin.js index 89689d6..98fb572 100644 --- a/core/modules/shortcut/shortcut.admin.js +++ b/core/modules/shortcut/shortcut.admin.js @@ -9,7 +9,7 @@ Drupal.behaviors.newSet = { attach: function (context, settings) { var selectDefault = function() { - $(this).closest('form').find('.form-item-set .form-type-radio').filter(':last').find('input').prop('checked', true); + $(this).closest('form').find('.form-item-set .form-type-radio input').last().prop('checked', true); }; $('div.form-item-new input').on('focus', selectDefault).on('keyup', selectDefault); } diff --git a/core/modules/tour/js/jquery.joyride-2.0.3.js b/core/modules/tour/js/jquery.joyride-2.0.3.js index b144fb9..72c2bef 100644 --- a/core/modules/tour/js/jquery.joyride-2.0.3.js +++ b/core/modules/tour/js/jquery.joyride-2.0.3.js @@ -648,8 +648,8 @@ return; } var tabbables = $(el).find(":tabbable"), - first = tabbables.filter(":first"), - last = tabbables.filter(":last"); + first = tabbables.first(), + last = tabbables.last(); if ( event.target === last[0] && !event.shiftKey ) { first.focus( 1 ); event.preventDefault(); diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index 3460f79..3f292f5 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -696,7 +696,7 @@ $.extend(Drupal.viewsUi.RearrangeFilterHandler.prototype, { // Within the row, the operator labels are displayed inside the first table // cell (next to the filter name). var $draggableRow = $(this.draggableRows[i]); - var $firstCell = $draggableRow.find('td').eq(0); + var $firstCell = $draggableRow.find('td').first(); if ($firstCell.length) { // The value of the operator label ("And" or "Or") is taken from the // first operator dropdown we encounter, going backwards from the current