X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Ffilter%2Ffilter.admin.js;fp=web%2Fcore%2Fmodules%2Ffilter%2Ffilter.admin.js;h=857a7046ad847a0ea301290507182c6a20416901;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=31e0582c18993e5a5393d22e06e170ab26ef9440;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/modules/filter/filter.admin.js b/web/core/modules/filter/filter.admin.js index 31e0582c1..857a7046a 100644 --- a/web/core/modules/filter/filter.admin.js +++ b/web/core/modules/filter/filter.admin.js @@ -1,69 +1,50 @@ /** - * @file - * Attaches administration-specific behavior for the Filter module. - */ +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ (function ($, Drupal) { - - 'use strict'; - - /** - * Displays and updates the status of filters on the admin page. - * - * @type {Drupal~behavior} - * - * @prop {Drupal~behaviorAttach} attach - * Attaches behaviors to the filter admin view. - */ Drupal.behaviors.filterStatus = { - attach: function (context, settings) { + attach: function attach(context, settings) { var $context = $(context); $context.find('#filters-status-wrapper input.form-checkbox').once('filter-status').each(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'); - // 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')) { $row.show(); if (filterSettingsTab) { filterSettingsTab.tabShow().updateSummary(); - } - else { - // On very narrow viewports, Vertical Tabs are disabled. + } else { $filterSettings.show(); } - } - else { + } else { $row.hide(); if (filterSettingsTab) { filterSettingsTab.tabHide().updateSummary(); - } - else { - // On very narrow viewports, Vertical Tabs are disabled. + } else { $filterSettings.hide(); } } - // Restripe table after toggling visibility of table row. + Drupal.tableDrag['filter-order'].restripeTable(); }); - // 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'); }); } - // Trigger our bound click handler to update elements to initial state. $checkbox.triggerHandler('click.filterUpdate'); }); } }; - -})(jQuery, Drupal); +})(jQuery, Drupal); \ No newline at end of file