ldc-boutique-cnc/integration/resources/js/cart.js
Olivier Legat d93553b396 Squashed commit of the following:
commit a962eca9b609623804bd8cfe57c246a61e77a382
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Thu Mar 4 17:41:46 2021 +0100

    responsive

commit a44ff3bde60c2af1db3169115a90741b8e868037
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Wed Mar 3 17:50:58 2021 +0100

    end tunnel

commit 4c40e47ae861909f76b92b0440d48b378ee621c2
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Tue Mar 2 18:10:17 2021 +0100

    heure de collecte

commit e05d598006060880f79573108e0c66fccfcfc62c
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Mon Mar 1 17:47:48 2021 +0100

    tunnel page 3

commit b85f96a655e868096aa42e9f99b2f67c49a041c3
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Fri Feb 26 13:16:05 2021 +0100

    Tunnel d'achat start

commit cdf9a38e8f5d38ffcc1728415f0b58b22ff455df
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Thu Feb 25 20:35:44 2021 +0100

    cart full

commit 9db34a8ab6881b1b88adebaa6426b6944608de47
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Wed Feb 24 17:40:18 2021 +0100

    work in progress - cart panel

commit 0a698cb62eb26b52f3b48f5ac8a39b89c34617f4
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Tue Feb 23 17:05:13 2021 +0100

    sassification des css

commit 5c277ae10d9ae8e0225a0f7d57d81146e43da146
Author: Olivier Legat <olivier.legat@ldc.fr>
Date:   Tue Feb 23 16:37:01 2021 +0100

    integration bato
2021-03-05 11:49:20 +01:00

45 lines
1.7 KiB
JavaScript
Vendored

/* Set the width of the sidebar to 250px (show it) */
window.openCart = function() {
$('.basket-panel__mask').addClass('basket-panel__mask--visible');
$('.basket-panel__drawer').addClass('basket-panel__drawer--opened');
$('body').addClass('cartOpened');
}
/* Set the width of the sidebar to 0 (hide it) */
window.closeCart = function() {
$('.basket-panel__mask').removeClass('basket-panel__mask--visible');
$('.basket-panel__drawer').removeClass('basket-panel__drawer--opened');
$('body').removeClass('cartOpened');
}
window.showPromoInfo = function() {
$(this).parent().next("section.promotion-slide").show();
}
window.hidePromoInfo = function(elem) {
$(this).parent().next("section.promotion-slide").hide();
}
window.toggleFixingBottomCart= function() {
let bottomHeight = $('.cart-tile__bottom').innerHeight();
if($(this).scrollTop() + $(this).innerHeight() >= ($(this)[0].scrollHeight)) {
$('.cart-tile__bottom.cart-tile__bottom--fixed').removeClass('cart-tile__bottom--fixed')
} else if($(this).scrollTop() + $(this).innerHeight() < ($(this)[0].scrollHeight-bottomHeight)) {
$('.cart-tile__bottom').not('.cart-tile__bottom--fixed').addClass('cart-tile__bottom--fixed');
}
}
window.toggleProductCategory = function() {
$(this).find('.category-heading__chevron').toggleClass('ds-chevron--revert');
$(this).next().toggle();
//raise a scroll event to check bottom cart fixing
$('.basket-panel__content--smooth-scroll').scroll();
}
window.showModalClearCart = function() {
$('#empty-basket-modal > div.modal').show();
}
window.closeModalClearCart = function() {
$('#empty-basket-modal > div.modal').hide();
}