1(function ($, Drupal, once) { 2 "use strict"; 3 4 Drupal.behaviors.componentDataTable = { 5 attach: function (context) { 6 $(once("table-init", ".component-data-table", context)).each(function () { 7 const $table = $(this); 8 const headers = []; 9 10 $table.find(".ss-header-item").each(function () { 11 headers.push($(this).text().trim()); 12 }); 13 14 const $rows = $table.find(".ss-table-row"); 15 16 $rows.each(function (rowIndex) { 17 const $row = $(this); 18 19 if (rowIndex === 0) { 20 $row.addClass("is-expanded"); 21 } 22 23 $row.find(".ss-collapsible-item").each(function () { 24 const $cell = $(this); 25 const cellIndex = $row.children().index($cell); 26 27 if ( 28 headers[cellIndex] && 29 $cell.find(".mobile-label").length === 0 30 ) { 31 $cell.prepend( 32 '<div class="mobile-label"><strong>' + 33 headers[cellIndex] + 34 "</strong></div>" 35 ); 36 } 37 }); 38 39 // Toggle logic 40 const $trigger = $row.find(".ss-row-toggle"); 41 42 $(once("row-click", $trigger)).on("click", function () { 43 $row.toggleClass("is-expanded"); 44 }); 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.