1(function ($, Drupal) { 2 Drupal.behaviors.carouselToggle = { 3 attach: function (context, settings) { 4 once('carouselToggle', '#toggleCarousel', context).forEach(function (button) { 5 let carouselEl = document.querySelector('#hero-carousel'); 6 if (!carouselEl) { 7 return; 8 } 9 10 // Initialize Bootstrap 5 carousel 11 let carousel = bootstrap.Carousel.getOrCreateInstance(carouselEl, { 12 interval: 5000, 13 pause: false 14 }); 15 16 let paused = false; 17 18 // Play/Pause trigger 19 button.addEventListener('click', function () { 20 if (paused) { 21 carousel.cycle(); // resume auto sliding 22 } else { 23 carousel.pause(); // pause auto sliding 24 } 25 paused = !paused; 26 27 // Toggle Font Awesome icon 28 $(this).find('i').toggleClass('fa-play fa-pause'); 29 }); 30 }); 31 } 32 }; 33})(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.