diff --git a/_dev/js/theme/components/quickview.js b/_dev/js/theme/components/quickview.js index f9d5baa6..bc27665f 100644 --- a/_dev/js/theme/components/quickview.js +++ b/_dev/js/theme/components/quickview.js @@ -1,4 +1,3 @@ -import $ from 'jquery'; import prestashop from 'prestashop'; import DOMReady from '../utils/DOMReady'; import parseToHtml from '../utils/parseToHtml'; @@ -6,21 +5,18 @@ import parseToHtml from '../utils/parseToHtml'; /** * Handle open quick view */ -const handleQuickViewOpen = ({ - resp, -}) => { - const body = document.querySelector('body'); - body.append(parseToHtml(resp.quickview_html)); +const handleQuickViewOpen = ({ resp }) => { + const body = document.body; - // TO DO REMOVE JQUERY - const productModal = $( - `#quickview-modal-${resp.product.id}-${resp.product.id_product_attribute}`, - ); - productModal.modal('show'); + const quickviewHtml = parseToHtml(resp.quickview_html); + body.appendChild(quickviewHtml); + + const productModal = document.getElementById(`quickview-modal-${resp.product.id}-${resp.product.id_product_attribute}`); + productModal.classList.add('show'); body.classList.add('js-quickview-open'); - productModal.on('hidden.bs.modal', () => { + productModal.addEventListener('hidden.bs.modal', () => { productModal.remove(); body.classList.remove('js-quickview-open'); });