PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 81 releases
ablocks / assets / build / blocks / carousel / view.js

view.js in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.14.0, at assets/build/blocks/carousel/view.js

3 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";function e(e={},t={}){const a=e=>null!=e&&""!==e,s=window.ABlocksGlobal||{},o=[{suffix:"Tablet",max:parseInt(s.breakpoints?.tablet,10)||800},{suffix:"Mobile",max:parseInt(s.breakpoints?.mobile,10)||480},...(s.responsive_devices||[]).filter(e=>e?.suffix&&"Tablet"!==e.id&&"Mobile"!==e.id&&!(parseInt(e.min,10)>0)&&parseInt(e.max,10)>0).map(e=>({suffix:e.suffix,max:parseInt(e.max,10)}))].sort((e,t)=>t.max-e.max);let r=a(e?.value)?e.value:1,l=a(t?.value)?t.value:0;const i={[o[0].max+1]:{slidesPerView:r,spaceBetween:l}};return o.forEach((s,n)=>{const u=e?.["value"+s.suffix],c=t?.["value"+s.suffix];r=a(u)?u:r,l=a(c)?c:l;const p=o[n+1];i[p?p.max+1:0]={slidesPerView:r,spaceBetween:l}}),i}document.addEventListener("DOMContentLoaded",()=>{!function(e,t,a="ablocksInitialized"){e&&("function"==typeof e.forEach?e:[e]).forEach(e=>{e&&e.dataset&&!e.dataset[a]&&(e.dataset[a]="1",t(e))})}(document.querySelectorAll(".ablocks-block--carousel"),t=>{!function(t,a){if(!t)return null
2 ;const s=t?.querySelector(".ablocks-carousel-swiper"),o=t?.querySelector(".ablocks-carousel-navigation__button--prev"),r=t?.querySelector(".ablocks-carousel-navigation__button--next"),l=t?.querySelector(".ablocks-carousel-pagination"),i=s?.getAttribute("data-swiper-options"),n=s?.getAttribute("data-swiper-frontend-options"),u=JSON.parse(s?.getAttribute("data-swiper-slides-per-view")),c=JSON.parse(s?.getAttribute("data-swiper-gap")),p=t?.querySelector(".ablocks-carousel-autoplay-progress svg"),b=t?.querySelector(".ablocks-carousel-autoplay-progress span"),f=JSON.parse(i),d=JSON.parse(n),v={navigation:{nextEl:r,prevEl:o,disabledClass:"ablocks-carousel-navigation__button--disabled"},pagination:{el:l,clickable:!!f.paginationClickable}};s&&new Swiper(s,{observer:!0,observeParents:!0,...a?{}:{allowTouchMove:!1,simulateTouch:!1},...v,...d,breakpoints:a&&"slide"===d?.effect?e(u,c):{},on:{autoplayTimeLeft(e,t,a){p&&p.style.setProperty("--progress",1-a),b&&(b.textContent=`${Math.ceil(t/1e3)}s`)}
3 }})}(t,!0)},"ablocksCarouselInit")})})();