PageSourceSearch

https://www.nestleprofessional.co.za/modules/contrib/responsive_tables_filter/js/Drupal/accessibility.js?v=1.x

js nestleprofessional.co.za collected 2026-10-08 00:46:42 UTC 1,307 bytes, 44 lines download raw bytes

1/**
2 * @file
3 * Customizations to original Tablesaw library.
4 *
5 * If and when fixes are applied upstream, these changes can be removed.
6 */
7
8(function ($, Drupal) {
9
10  'use strict';
11
12  Drupal.responsive_tables_filter = Drupal.responsive_tables_filter || {};
13  Drupal.behaviors.responsiveTablesAccessibility = {
14    attach: function (context) {
15      if (window.Tablesaw !== 'undefined') {
16        if (once('tablesaw-create', 'html').length) {
17          $(window).on(Tablesaw.events.create, function (event, tablesaw) {
18            Drupal.responsive_tables_filter.fixCellLabels(context);
19          });
20        }
21      }
22    }
23  };
24
25  /**
26   * Find all Tablesaw-generated cell labels.
27   */
28  Drupal.responsive_tables_filter.fixCellLabels = function (context) {
29    var $labels = $('b.tablesaw-cell-label');
30    $labels.each(Drupal.responsive_tables_filter.makeElementAccessible);
31  };
32
33  /**
34   * Replace all Tablesaw-generated b elements with strong.
35   */
36  Drupal.responsive_tables_filter.makeElementAccessible = function () {
37    var replacement = document.createElement('strong');
38    replacement.innerHTML = $(this).html();
39    replacement.setAttribute('class', $(this).attr('class'));
40    replacement.setAttribute('aria-hidden', true);
41    $(this).replaceWith(replacement);
42  };
43
44})(jQuery, Drupal);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.