1(function(util){ 2 3 var projectListBlockType = registerComponentType('projectlistblock'); 4 5 projectListBlockType.onCreate(function(component){ 6 7 const sliderOptions = { 8 align: 'start', 9 autoResize: false, 10 loop: true 11 }; 12 13 const embla = window.app.slider(component.getElement('slider'), sliderOptions); 14 15 component.onDOMEvent('nextSlide', 'click', function(){ 16 embla.scrollNext(); 17 }); 18 19 component.onDOMEvent('prevSlide', 'click', function(){ 20 embla.scrollPrev(); 21 }); 22 23 component.onResize(function(matches){ 24 let slides = 1; 25 if(window.matchMedia('(min-width: 1200px)').matches){ 26 slides = 2; 27 } 28 29 if(embla.slideNodes().length <= slides){ 30 component.getElement('controls').setAttribute('hidden', ''); 31 sliderOptions.draggable = false; 32 embla.scrollTo(0); 33 }else{ 34 component.getElement('controls').removeAttribute('hidden'); 35 sliderOptions.draggable = true; 36 } 37 38 component.getElement('slider').setAttribute('data-slides', slides); 39 embla.reInit(sliderOptions); 40 }); 41 42 }); 43 44 projectListBlockType.autoRegisterComponents(); 45 46})(window.jQueryPolyfill);
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.