diff --git a/core/modules/filter/filter.admin.js b/core/modules/filter/filter.admin.js index cde65a5..182b0f1 100644 --- a/core/modules/filter/filter.admin.js +++ b/core/modules/filter/filter.admin.js @@ -9,19 +9,18 @@ Drupal.behaviors.filterStatus = { attach: function (context, settings) { - var $context = $(context); - $context.find('#filters-status-wrapper input.form-checkbox').once('filter-status', function () { - var $checkbox = $(this); - // Retrieve the tabledrag row belonging to this filter. - var $row = $context.find('#' + $checkbox.attr('id').replace(/-status$/, '-weight')).closest('tr'); - // Retrieve the vertical tab belonging to this filter. - var $filterSettings = $context.find('#' + $checkbox.attr('id').replace(/-status$/, '-settings')); - var filterSettingsTab = $filterSettings.data('verticalTab'); + $(context).find('#filters-status-wrapper input.form-checkbox').once('filter-status', function () { + var $checkbox = $(this), + // Retrieve the tabledrag row belonging to this filter. + $row = $('#' + $checkbox.attr('id').replace(/-status$/, '-weight')).closest('tr'), + // Retrieve the vertical tab belonging to this filter. + $filterSettings = $('#' + $checkbox.attr('id').replace(/-status$/, '-settings')), + filterSettingsTab = $filterSettings.data('verticalTab'); // Bind click handler to this checkbox to conditionally show and hide the // filter's tableDrag row and vertical tab pane. $checkbox.on('click.filterUpdate', function () { - if ($checkbox.is(':checked')) { + if ($checkbox.prop('checked')) { $row.show(); if (filterSettingsTab) { filterSettingsTab.tabShow().updateSummary(); @@ -48,12 +47,12 @@ Drupal.behaviors.filterStatus = { // Attach summary for configurable filters (only for screen-readers). if (filterSettingsTab) { filterSettingsTab.details.drupalSetSummary(function (tabContext) { - return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled'); + return $checkbox.prop('checked') ? Drupal.t('Enabled') : Drupal.t('Disabled'); }); } // Trigger our bound click handler to update elements to initial state. - $checkbox.triggerHandler('click.filterUpdate'); + $checkbox.trigger('click.filterUpdate'); }); } }; diff --git a/core/modules/filter/filter.js b/core/modules/filter/filter.js index 2bab50b..5694332 100644 --- a/core/modules/filter/filter.js +++ b/core/modules/filter/filter.js @@ -14,15 +14,15 @@ Drupal.behaviors.filterGuidelines = { attach: function (context) { function updateFilterGuidelines (event) { - var $this = $(event.target); - var value = $this.val(); + var $this = $(event.target), + value = $this.val(); $this.closest('.filter-wrapper') .find('.filter-guidelines-item').hide() .filter('.filter-guidelines-' + value).show(); } - $(context).find('.filter-guidelines').once('filter-guidelines') - .find(':header').hide() + $('.filter-guidelines').once('filterGuidelines') + .find('h1, h2, h3, h4, h5, h6').hide() .closest('.filter-wrapper').find('select.filter-list') .on('change.filterGuidelines', updateFilterGuidelines) // Need to trigger the namespaced event to avoid triggering formUpdated