wickes-css2 2.105.0-develop.10 → 2.105.0-develop.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,10 +40,11 @@ import {
40
40
  getMessageInfo,
41
41
  isMessageExist,
42
42
  updatePromotion,
43
- showNotification,
44
- } from './basket/basket-utils';
45
- import { updateCartBase } from './basket/basket-update-cart';
46
- import { updateCartActionBase } from './basket/basket-update-cart-action';
43
+ showNotification
44
+ } from "./basket/basket-utils";
45
+ import {updateCartBase} from "./basket/basket-update-cart";
46
+ import {updateCartActionBase} from "./basket/basket-update-cart-action";
47
+ import {initBillieModal} from "./components/billie-modal";
47
48
 
48
49
  var Wick = window.Wick || {};
49
50
  Wick.BasketPage = {
@@ -1342,6 +1343,7 @@ $(document).ready(function () {
1342
1343
 
1343
1344
  setDefaultCharityValue();
1344
1345
  initCharityInteractions();
1346
+ initBillieModal();
1345
1347
  if (!$(Wick.BasketPage.el.loader).length) {
1346
1348
  appendLoader(Wick.BasketPage.loaderPayload);
1347
1349
  }
@@ -0,0 +1,31 @@
1
+ const billieEl = {
2
+ modalId: '#billieLearnMoreModal',
3
+ openLink: '.billie__link[data-target="#billieLearnMoreModal"]',
4
+ scrollBody: '.modal-body.modal-box__body',
5
+ content: '.modal-content.modal-box__content',
6
+ };
7
+
8
+ function resetBillieModalScroll($modal) {
9
+ const bodyEl = $modal.find(billieEl.scrollBody)[0];
10
+ if (bodyEl) bodyEl.scrollTop = 0;
11
+ $modal.find(billieEl.content).attr('data-scroll-state', 'top');
12
+ }
13
+
14
+ export function initBillieModal() {
15
+ const $modal = $(billieEl.modalId);
16
+ if (!$modal.length) return;
17
+
18
+ $(document).on('click', billieEl.openLink, function () {
19
+ resetBillieModalScroll($modal);
20
+ });
21
+
22
+ $(document).on('shown.bs.modal', billieEl.modalId, function () {
23
+ resetBillieModalScroll($modal);
24
+ requestAnimationFrame(() => resetBillieModalScroll($modal));
25
+ setTimeout(() => resetBillieModalScroll($modal), 30);
26
+ });
27
+
28
+ $(document).on('hidden.bs.modal', billieEl.modalId, function () {
29
+ resetBillieModalScroll($modal);
30
+ });
31
+ }