summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/extensions/blocks/slideshow/create-swiper.js')
-rw-r--r--plugins/jetpack/extensions/blocks/slideshow/create-swiper.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/plugins/jetpack/extensions/blocks/slideshow/create-swiper.js b/plugins/jetpack/extensions/blocks/slideshow/create-swiper.js
deleted file mode 100644
index 72a54f56..00000000
--- a/plugins/jetpack/extensions/blocks/slideshow/create-swiper.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * External dependencies
- */
-import { mapValues, merge } from 'lodash';
-
-/**
- * Internal dependencies
- */
-import './style.scss';
-
-export default async function createSwiper(
- container = '.swiper-container',
- params = {},
- callbacks = {}
-) {
- const defaultParams = {
- effect: 'slide',
- grabCursor: true,
- init: true,
- initialSlide: 0,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- pagination: {
- bulletElement: 'button',
- clickable: true,
- el: '.swiper-pagination',
- type: 'bullets',
- },
- preventClicksPropagation: false /* Necessary for normal block interactions */,
- releaseFormElements: false,
- setWrapperSize: true,
- touchStartPreventDefault: false,
- on: mapValues(
- callbacks,
- callback =>
- function() {
- callback( this );
- }
- ),
- };
- const [ { default: Swiper } ] = await Promise.all( [
- import( /* webpackChunkName: "swiper" */ 'swiper/dist/js/swiper.js' ),
- import( /* webpackChunkName: "swiper" */ 'swiper/dist/css/swiper.css' ),
- ] );
- return new Swiper( container, merge( {}, defaultParams, params ) );
-}