1(function(Drupal,$,once,drupalSettings){'use strict';Drupal.behaviors.pgMostPopularDegrees={attach:function(context,settings){let delay=0;if($('.js-lpb-component',context).length>0){delay=1000} 2setTimeout(()=>{once('pgMostPopularDegreesFilmstrip','.paragraph--type--most-popular-degrees-section',context).forEach(function(paragraph){const $filmstrip=$(paragraph).find('.filmstrip'),$filmstripContainer=$(paragraph).find('.filmstrip-container'),$rowContainer=$(paragraph).find('.row-container'),$prevButton=$(paragraph).find('.filmstrip-prev'),$nextButton=$(paragraph).find('.filmstrip-next'),$dotsButton=$(paragraph).find('.filmstrip-dots button'),filmstripSlides=$(paragraph).find('.filmstrip-slide').length,minWidth=772,minLgWidth=1400,minSwitchWidth=630;let currentIndex=0;function getCardsPerSlide(){return 1} 3function updateSlide(){const $dotsList=$(paragraph).find('.filmstrip-dots');const $currentSlide=$dotsList.find('button[aria-current="true"]');const m=getCardsPerSlide();const cardWidth=$filmstrip.find('.filmstrip-slide:eq(0)').width()+20;const offset=currentIndex*cardWidth;$('> li',$dotsList).removeClass('filmstrip-active');$('> li > button',$dotsList).removeAttr('aria-current');$dotsList.find('button[data-filmstrip-slide="'+parseInt(currentIndex+1)+'"]').attr('aria-current','true');$dotsList.find('button[data-filmstrip-slide="'+parseInt(currentIndex+1)+'"]').parent('li').addClass('filmstrip-active');$filmstrip.find('.filmstrip-dots button, .carousel-control-prev, .carousel-control-next').attr('tabindex','0');$filmstrip.find('.filmstrip-slide a, .filmstrip-slide button').attr('tabindex','-1');$filmstrip.find('.filmstrip-slide:eq('+currentIndex+')').find('a, button').attr('tabindex','0');if(window.innerWidth>=minWidth){if($filmstrip.find('.filmstrip-slide:eq('+parseInt(currentIndex+1)+')').length){$filmstrip.find('.filmstrip-slide:eq('+parseInt(currentIndex+1)+')').find('a, button').attr('tabindex','0')} 4if($filmstrip.find('.filmstrip-slide:eq('+parseInt(currentIndex+2)+')').length){$filmstrip.find('.filmstrip-slide:eq('+parseInt(currentIndex+2)+')').find('a, button').attr('tabindex','0')}} 5$filmstrip.css('transform',`translateX(-${offset}px)`);$filmstrip.find('.filmstrip-slide').css({'visibility':'visible','opacity':'1'});for(var i=currentIndex;i>0;i--){var prevIndex=parseInt(i)-1;$filmstrip.find('.filmstrip-slide:eq('+prevIndex+')').addClass('slow') 6$filmstrip.find('.filmstrip-slide:eq('+prevIndex+')').css({'visibility':'hidden','opacity':'0'})} 7setTimeout(()=>{for(var i=currentIndex;i>0;i--){var prevIndex=parseInt(i)-1;$filmstrip.find('.filmstrip-slide:eq('+prevIndex+')').removeClass('slow')}},1000)} 8function advanceNext(){const m=getCardsPerSlide();currentIndex+=m;if(currentIndex>=filmstripSlides){currentIndex=0} 9updateSlide()} 10function advancePrev(){const m=getCardsPerSlide();currentIndex-=m;if(currentIndex<0){currentIndex=Math.max(0,filmstripSlides-m)} 11updateSlide()} 12function toggleControls(){$(paragraph).find('.filmstrip-navigation').hide();if((window.innerWidth>=minLgWidth&&filmstripSlides>3)||(window.innerWidth>=minWidth&&window.innerWidth<minLgWidth&&filmstripSlides>2)||(window.innerWidth<minWidth&&filmstripSlides>1)){$(paragraph).find('.filmstrip-navigation').show()} 13if(window.innerWidth<=minSwitchWidth){$rowContainer.removeClass('row')}else{$rowContainer.addClass('row')} 14setTimeout(()=>{var cardHeight=0;$filmstrip.css('height','');$filmstrip.find('.filmstrip-slide').each(function(){if($(this).innerHeight()>cardHeight){cardHeight=$(this).innerHeight()}});$filmstrip.css('height',cardHeight)},100)} 15$prevButton.on('click',function(){advancePrev()});$nextButton.on('click',function(){advanceNext()});$dotsButton.on('click',function(){const $dotsList=$(this).closest('.filmstrip-dots');$('> li',$dotsList).removeClass('filmstrip-active');$('> li > button',$dotsList).removeAttr('aria-current');$(this).attr('aria-current','true');$(this).parent('li').addClass('filmstrip-active');currentIndex=parseInt($(this).data('filmstrip-slide'))-1;updateSlide()});window.addEventListener('resize',()=>{setTimeout(()=>{updateSlide();toggleControls()},10)});updateSlide();toggleControls()})},delay)},}})(Drupal,jQuery,once,drupalSettings)
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.