//////////////////////////////// Tabbed Content //////////////////////////////// /** * NOTE: Tab elements are whitelisted elements that do not trigger * smoothscroll when clicked. The whitelist is defined in content-interactions.js. **/ import $ from 'jquery'; import { scrollToAnchor } from './content-interactions.js'; function tabbedContent(container, tab, content) { // Add the active class to the first tab in each tab group, // in case it wasn't already set in the markup. $(container).each(function () { $(tab, this).removeClass('is-active'); $(tab + ':first', this).addClass('is-active'); }); $(tab).on('click', function (e) { e.preventDefault(); // Make sure the tab being clicked is marked as active, and make the rest inactive. $(this).addClass('is-active').siblings().removeClass('is-active'); // Render the correct tab content based on the position of the tab being clicked. const activeIndex = $(tab).index(this); $(content).each(function (i) { if (i === activeIndex) { $(this).show(); $(this).siblings(content).hide(); } }); }); } function getTabQueryParam() { const queryParams = new URLSearchParams(window.location.search); return $('