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();