1/** 2 * @file 3 * Handle the tab component 4 * 5 */ 6 7(function ($, Drupal) { 8 Drupal.behaviors.tab_component = { 9 attach: async function (context) { 10 ('use strict'); 11 12 $('.tab-button').on('click', function () { 13 $(this) 14 .closest('.tab-container') 15 .find('.tab-content.is-active') 16 .removeClass('is-active'); 17 18 $(this) 19 .closest('.tab-container') 20 .find('.tab-button.is-active') 21 .removeClass('is-active') 22 .attr('aria-selected', 'false'); 23 24 $(this).addClass('is-active'); 25 26 const idArray = this.id.split('-'); 27 const id = idArray[idArray.length - 1]; 28 $('#tab-content-' + id) 29 .addClass('is-active') 30 .attr('aria-selected', 'true'); 31 }); 32 }, 33 }; 34})(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.