1/** 2* DO NOT EDIT THIS FILE. 3* See the following change record for more information, 4* https://www.drupal.org/node/2815083 5* @preserve 6**/ 7 8(function (Drupal, once) { 9 function init(el) { 10 var tabs = el.querySelector('.tabs'); 11 var expandedClass = 'is-expanded'; 12 var activeTab = tabs.querySelector('.is-active'); 13 14 function isTabsMobileLayout() { 15 return tabs.querySelector('.tabs__trigger').clientHeight > 0; 16 } 17 18 function handleTriggerClick(e) { 19 if (!tabs.classList.contains(expandedClass)) { 20 e.currentTarget.setAttribute('aria-expanded', 'true'); 21 tabs.classList.add(expandedClass); 22 } else { 23 e.currentTarget.setAttribute('aria-expanded', 'false'); 24 tabs.classList.remove(expandedClass); 25 } 26 } 27 28 if (isTabsMobileLayout() && !activeTab.matches('.tabs__tab:first-child')) { 29 var newActiveTab = activeTab.cloneNode(true); 30 var firstTab = tabs.querySelector('.tabs__tab:first-child'); 31 tabs.insertBefore(newActiveTab, firstTab); 32 tabs.removeChild(activeTab); 33 } 34 35 tabs.querySelector('.tabs__trigger').addEventListener('click', handleTriggerClick); 36 } 37 38 Drupal.behaviors.primaryTabs = { 39 attach: function attach(context) { 40 once('drupal-tabs', '[data-drupal-nav-primary-tabs]', context).forEach(init); 41 } 42 }; 43})(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.