Security update to Drupal 8.4.6
[yaffs-website] / web / core / modules / filter / filter.admin.js
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function ($, Drupal) {
9   Drupal.behaviors.filterStatus = {
10     attach: function attach(context, settings) {
11       var $context = $(context);
12       $context.find('#filters-status-wrapper input.form-checkbox').once('filter-status').each(function () {
13         var $checkbox = $(this);
14
15         var $row = $context.find('#' + $checkbox.attr('id').replace(/-status$/, '-weight')).closest('tr');
16
17         var $filterSettings = $context.find('#' + $checkbox.attr('id').replace(/-status$/, '-settings'));
18         var filterSettingsTab = $filterSettings.data('verticalTab');
19
20         $checkbox.on('click.filterUpdate', function () {
21           if ($checkbox.is(':checked')) {
22             $row.show();
23             if (filterSettingsTab) {
24               filterSettingsTab.tabShow().updateSummary();
25             } else {
26               $filterSettings.show();
27             }
28           } else {
29             $row.hide();
30             if (filterSettingsTab) {
31               filterSettingsTab.tabHide().updateSummary();
32             } else {
33               $filterSettings.hide();
34             }
35           }
36
37           Drupal.tableDrag['filter-order'].restripeTable();
38         });
39
40         if (filterSettingsTab) {
41           filterSettingsTab.details.drupalSetSummary(function (tabContext) {
42             return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled');
43           });
44         }
45
46         $checkbox.triggerHandler('click.filterUpdate');
47       });
48     }
49   };
50 })(jQuery, Drupal);