PageSourceSearch

https://stahlin.com/modules/contrib/better_exposed_filters/js/better_exposed_filters.js?tlurih

js stahlin.com collected 2026-09-29 09:26:33 UTC 1,481 bytes, 49 lines download raw bytes

1/**
2 * @file
3 * better_exposed_filters.js
4 *
5 * Provides some client-side functionality for the Better Exposed Filters module.
6 */
7
8(function ($, Drupal, once) {
9  Drupal.behaviors.betterExposedFilters = {
10    attach: function (context) {
11      // Add highlight class to checked checkboxes for better theming.
12      $('.bef-tree input[type=checkbox], .bef-checkboxes input[type=checkbox]')
13        // Highlight newly selected checkboxes.
14        .change(function () {
15          _bef_highlight(this, context);
16        })
17        .filter(':checked').closest('.form-item', context).addClass('highlight');
18    }
19  };
20
21  /*
22   * Helper functions
23   */
24
25  /**
26   * Adds/Removes the highlight class from the form-item div as appropriate.
27   */
28  function _bef_highlight(elem, context) {
29    $elem = $(elem, context);
30    $elem.attr('checked')
31      ? $elem.closest('.form-item', context).addClass('highlight')
32      : $elem.closest('.form-item', context).removeClass('highlight');
33  }
34
35  /**
36   * Adds the data-bef-auto-submit-exclude to elements with type="text".
37   */
38  Drupal.behaviors.autosubmitExcludeTextfield = {
39    attach: function (context, settings) {
40      if (!settings.better_exposed_filters?.autosubmit_exclude_textfield) {
41        return;
42      }
43      $(once('autosubmit-exclude-textfield', '.bef-exposed-form', context)).each(function () {
44        $(this).find('*[type="text"]').attr('data-bef-auto-submit-exclude', '');
45      });
46    }
47  };
48
49})(jQuery, Drupal, once);

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.