Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / views_ui / js / views_ui.listing.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.viewTableFilterByText = {
10     attach: function attach(context, settings) {
11       var $input = $('input.views-filter-text').once('views-filter-text');
12       var $table = $($input.attr('data-table'));
13       var $rows = void 0;
14
15       function filterViewList(e) {
16         var query = $(e.target).val().toLowerCase();
17
18         function showViewRow(index, row) {
19           var $row = $(row);
20           var $sources = $row.find('[data-drupal-selector="views-table-filter-text-source"]');
21           var textMatch = $sources.text().toLowerCase().indexOf(query) !== -1;
22           $row.closest('tr').toggle(textMatch);
23         }
24
25         if (query.length >= 2) {
26           $rows.each(showViewRow);
27         } else {
28           $rows.show();
29         }
30       }
31
32       if ($table.length) {
33         $rows = $table.find('tbody tr');
34         $input.on('keyup', filterViewList);
35       }
36     }
37   };
38 })(jQuery, Drupal);