$(document).ready(function() { // Check if URL has 'emailReferral' parameter let modalContainer = $('.block-component-popup-modal'); let urlParams = new URLSearchParams(window.location.search); let setParameter = $(modalContainer).attr('data-parameter'); if(urlParams.has(setParameter)) { $(modalContainer).show(); } // Close modal when clicking on 'modalClose' $('.block-component-popup-modal--close').click(function() { $(modalContainer).hide(); }); // Close modal when clicking outside of it $(window).click(function(e) { if($(e.target).is('.block-component-popup-modal')) { $('.block-component-popup-modal').hide(); } }); }); ; jQuery(document).ready(function(){wordCountResize("body-text",50),wordCountResize("title-wrapper",10),wordCountResize("body-text",50),wordCountResize("title-wrapper",10)}); //# sourceMappingURL=block-min.js.map ; jQuery(document).ready(function () { var h2Counter = 1; // Initialize a counter for h2 elements // Iterate through each .block-long-form-content-with-sidebar element jQuery(".block-long-form-content-with-sidebar").each(function () { var ul = jQuery(""); // Create a new unordered list // Find all h2 elements inside the .main-content div of the current block jQuery(this) .find(".main-content h2") .each(function () { // Generate a unique ID for each h2 var h2Id = "h2-number-" + h2Counter++; jQuery(this).attr("id", h2Id); var text = jQuery(this).text(); // Get the text of each h2 // Create an anchor link and list item for each h2 var li = jQuery("
  • "); var anchor = jQuery("") .attr("href", "#" + h2Id) .text(text); li.append(anchor); ul.append(li); }); // Append the unordered list to the .custom-links-false div of the current block jQuery(this).find(".custom-links-false").append(ul); }); // Smooth scroll function for links generated within .custom-links-false jQuery('.custom-links-false a[href*="#"]').on("click", function (e) { e.preventDefault(); var target = jQuery(this).attr("href"); // Get the target ID from href if (jQuery(target).length) { // Ensure the target element exists jQuery("html, body").animate( { scrollTop: jQuery(target).offset().top - 115, }, 1000 ); } }); // Click to open sidebar jQuery(".block-long-form-content-with-sidebar .sidebar-title").on("click", function () { jQuery(this).siblings("ul").slideToggle(500); }); }); ; /* Wrap all iframe in special wrapper so they can be made responsive -------------------------------------------------------------- */ jQuery('.block-long-form-content-v1 iframe').wrap('
    '); /* Nav logic -------------------------------------------------------------- */ // Loop through each block with the class "long-form-content-v1" jQuery(".block-long-form-content-v1").each(function() { // Create a new unordered list to hold the anchor links var anchorList = jQuery(""); // Loop through each H2 heading within the current block jQuery(this).find("h2").each(function() { // If the H2 does not have a class of "nav-title", create an anchor link for it if (!jQuery(this).hasClass("nav-title")) { // Create a unique ID for the H2 element var id = jQuery(this).text().trim().toLowerCase().replace(/[^a-z0-9]+/g, "-"); jQuery(this).attr("id", id); // Create a new list item with an anchor link to the H2 element var listItem = jQuery("
  • "); var anchor = jQuery("").attr("href", "#" + id).text(jQuery(this).text()); listItem.append(anchor); // Add the new list item to the unordered list anchorList.append(listItem); } }); // Add the unordered list to the block's anchor-links container jQuery(this).find(".anchor-links").append(anchorList); }); /* Smooth scroll -------------------------------------------------------------- */ jQuery(".block-long-form-content-v1 .smooth-scroll").click(function (event) { jQuery("html,body").animate( { scrollTop: jQuery(this.hash).offset().top - 20 }, 1500 ); }); ;