2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
8 (function ($, Drupal, drupalSettings) {
9 Drupal.behaviors.simpleTestGroupCollapse = {
10 attach: function attach(context) {
11 $(context).find('.simpletest-group').once('simpletest-group-collapse').each(function () {
13 var $image = $group.find('.simpletest-image');
14 $image.html(drupalSettings.simpleTest.images[0]).on('click', function () {
15 var $tests = $group.nextUntil('.simpletest-group');
16 var expand = !$group.hasClass('expanded');
17 $group.toggleClass('expanded', expand);
18 $tests.toggleClass('js-hide', !expand);
19 $image.html(drupalSettings.simpleTest.images[+expand]);
25 Drupal.behaviors.simpleTestSelectAll = {
26 attach: function attach(context) {
27 $(context).find('.simpletest-group').once('simpletest-group-select-all').each(function () {
29 var $cell = $group.find('.simpletest-group-select-all');
30 var $groupCheckbox = $('<input type="checkbox" id="' + $cell.attr('id') + '-group-select-all" class="form-checkbox" />');
31 var $testCheckboxes = $group.nextUntil('.simpletest-group').find('input[type=checkbox]');
32 $cell.append($groupCheckbox);
34 $groupCheckbox.on('change', function () {
35 var checked = $(this).prop('checked');
36 $testCheckboxes.prop('checked', checked);
39 function updateGroupCheckbox() {
40 var allChecked = true;
41 $testCheckboxes.each(function () {
42 if (!$(this).prop('checked')) {
47 $groupCheckbox.prop('checked', allChecked);
50 $testCheckboxes.on('change', updateGroupCheckbox);
55 Drupal.behaviors.simpletestTableFilterByText = {
56 attach: function attach(context) {
57 var $input = $('input.table-filter-text').once('table-filter-text');
58 var $table = $($input.attr('data-table'));
62 function filterTestList(e) {
63 var query = $(e.target).val().toLowerCase();
65 function showTestRow(index, row) {
67 var $sources = $row.find('.table-filter-text-source');
68 var textMatch = $sources.text().toLowerCase().indexOf(query) !== -1;
69 $row.closest('tr').toggle(textMatch);
72 if (query.length >= 3) {
74 $('#simpletest-form-table thead th.select-all input').hide();
76 $rows.each(showTestRow);
77 } else if (searched) {
79 $('#simpletest-form-table thead th.select-all input').show();
81 $rows.css('display', '');
86 $rows = $table.find('tbody tr');
87 $input.trigger('focus').on('keyup', Drupal.debounce(filterTestList, 200));
91 })(jQuery, Drupal, drupalSettings);