From ad9fd99f8caaee7b6f3b43a8a492018334030690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Ste=CC=A8pien=CC=81?= Date: Mon, 9 Oct 2023 23:52:16 +0200 Subject: [PATCH] Removing jquery, slider componnet --- _dev/js/theme/components/sliders.js | 8 ++++---- _dev/js/theme/components/sliders/SwiperSlider.js | 2 +- _dev/js/theme/index.js | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/_dev/js/theme/components/sliders.js b/_dev/js/theme/components/sliders.js index 0fa44d56..e078cae8 100644 --- a/_dev/js/theme/components/sliders.js +++ b/_dev/js/theme/components/sliders.js @@ -1,11 +1,11 @@ import prestashop from 'prestashop'; -import $ from 'jquery'; -import PageSlider from '@js/theme/components/sliders/PageSlider'; -import SwiperSlider from '@js/theme/components/sliders/SwiperSlider'; +import DOMReady from "../utils/DOMReady"; +import PageSlider from './sliders/PageSlider'; +import SwiperSlider from './sliders/SwiperSlider'; prestashop.pageSlider = new PageSlider(); prestashop.SwiperSlider = SwiperSlider; -$(() => { +DOMReady(() => { prestashop.pageSlider.init(); }); diff --git a/_dev/js/theme/components/sliders/SwiperSlider.js b/_dev/js/theme/components/sliders/SwiperSlider.js index 01902ffd..e9de38b8 100644 --- a/_dev/js/theme/components/sliders/SwiperSlider.js +++ b/_dev/js/theme/components/sliders/SwiperSlider.js @@ -2,7 +2,7 @@ import Swiper, { Navigation, Pagination, Autoplay, } from 'swiper'; -import DynamicImportSwiperModule from '@js/theme/components/sliders/DynamicImportSwiperModule'; +import DynamicImportSwiperModule from './DynamicImportSwiperModule'; /* eslint-disable */ const dynamicModulesMap = { diff --git a/_dev/js/theme/index.js b/_dev/js/theme/index.js index 9072b7e1..9441bcb5 100644 --- a/_dev/js/theme/index.js +++ b/_dev/js/theme/index.js @@ -26,6 +26,7 @@ import useThemeForm from './components/useThemeForm'; import PageLazyLoad from './components/Lazyload'; import httpRequestErrorHandler from './handler/error/httpRequestErrorHandler'; import usePageLoader from "./components/usePageLoader"; +import DOMReady from "./utils/DOMReady"; prestashop.pageLazyLoad = new PageLazyLoad({ selector: '.lazyload', @@ -36,7 +37,7 @@ prestashop.pageLoader = usePageLoader(); prestashop.on('handleError', httpRequestErrorHandler); -$(() => { +DOMReady(() => { const { init: initForm } = useThemeForm(); initForm(); bsCustomFileInput.init();