1/* Source and licensing information for the line(s) below can be found at https://www.naantali.fi/modules/contrib/better_exposed_filters/js/better_exposed_filters.js. */ 2/** 3 * @file 4 * better_exposed_filters.js 5 * 6 * Provides some client-side functionality for the Better Exposed Filters module. 7 */ 8 9(function ($, Drupal) { 10 Drupal.behaviors.betterExposedFilters = { 11 attach: function (context) { 12 // Add highlight class to checked checkboxes for better theming. 13 $('.bef-tree input[type=checkbox], .bef-checkboxes input[type=checkbox]') 14 // Highlight newly selected checkboxes. 15 .change(function () { 16 _bef_highlight(this, context); 17 }) 18 .filter(':checked').closest('.form-item', context).addClass('highlight'); 19 } 20 }; 21 22 /* 23 * Helper functions 24 */ 25 26 /** 27 * Adds/Removes the highlight class from the form-item div as appropriate. 28 */ 29 function _bef_highlight(elem, context) { 30 $elem = $(elem, context); 31 $elem.attr('checked') 32 ? $elem.closest('.form-item', context).addClass('highlight') 33 : $elem.closest('.form-item', context).removeClass('highlight'); 34 } 35 36})(jQuery, Drupal); 37 38/* Source and licensing information for the above line(s) can be found at https://www.naantali.fi/modules/contrib/better_exposed_filters/js/better_exposed_filters.js. */
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.