wickes-css2 2.96.0-develop.3 → 2.96.0-develop.5

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.
@@ -385,9 +385,9 @@ Wick.BasketPage = {
385
385
  callAction(payload, actionCallback, info)
386
386
  } else {
387
387
  if (initial) {
388
- Wick.BasketPage.getCartEntries(Wick.BasketData.updateCart);
389
- addClassToSummaryAside(Wick.BasketData.updateCart);
390
- const initialTotalPrice = Wick.BasketData.updateCart.totalPrice.value;
388
+ Wick.BasketPage.getCartEntries(Wick.BasketData.initialCartState);
389
+ addClassToSummaryAside(Wick.BasketData.initialCartState);
390
+ const initialTotalPrice = Wick.BasketData.initialCartState.totalPrice.value;
391
391
  updateClearpayVisibility(initialTotalPrice);
392
392
  } else {
393
393
  updateBasketDataQuantity();
@@ -1,5 +1,4 @@
1
1
  import {updateDiscount} from "./discounts";
2
- import {addClassToSummaryAside} from "../basket/summary-mobile";
3
2
 
4
3
  const osEl = {
5
4
  $summarySection: $('.summary'),
@@ -22,8 +22,8 @@ export function initStickyObserver(observedElements, stickyElements, collapseSel
22
22
  if ('IntersectionObserver' in window) {
23
23
  io = new IntersectionObserver(
24
24
  entries => {
25
- const anyInView = entries.some(e => e.isIntersecting);
26
- toggle(anyInView);
25
+ const shouldBeHidden = entries.some(e => e.isIntersecting || e.boundingClientRect.y < 0);
26
+ toggle(shouldBeHidden);
27
27
  },
28
28
  { rootMargin: '0px 0px -20% 0px', threshold: 0 }
29
29
  );
@@ -31,15 +31,15 @@ export function initStickyObserver(observedElements, stickyElements, collapseSel
31
31
  } else {
32
32
  // Fallback for older browsers
33
33
  function check() {
34
- let anyInView = false;
34
+ let anyInViewOrAbove = false;
35
35
  $observed.each(function () {
36
36
  const r = this.getBoundingClientRect();
37
- if (r.top < window.innerHeight * 0.8 && r.bottom > 0) {
38
- anyInView = true;
39
- return false; // break
37
+ if ((r.top < window.innerHeight * 0.8 && r.bottom > 0) || r.bottom < 0) {
38
+ anyInViewOrAbove = true;
39
+ return false;
40
40
  }
41
41
  });
42
- toggle(anyInView);
42
+ toggle(anyInViewOrAbove);
43
43
  }
44
44
  $(window)
45
45
  .off('scroll.sticky resize.sticky')