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, drupalSettings) { 9 Drupal.behaviors.betterExposedFilters = { 10 attach: function (context, settings) { 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})(jQuery, Drupal, drupalSettings);
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.