wickes-css2 2.109.0-develop.5 → 2.109.0-develop.7

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.
Files changed (48) hide show
  1. package/Readme.md +0 -1
  2. package/build/css/components/card-product-banner.css +1 -1
  3. package/build/css/components/special-opening-schedule-v2.css +1 -1
  4. package/build/css/components/special-opening-schedule.css +1 -1
  5. package/build/css/emulation.css +1 -1
  6. package/build/css/main.css +1 -1
  7. package/build/css/my-account-main-v2.css +1 -1
  8. package/build/css/my-account-main.css +1 -1
  9. package/build/css/pages/checkout-new.css +1 -1
  10. package/build/css/pages/page_merged-basket.css +1 -1
  11. package/build/css/pages/page_store-locator-details.css +1 -1
  12. package/build/css/pages/page_store-locator.css +1 -1
  13. package/build/css/plp-main.css +1 -1
  14. package/build/css/store-locator-main.css +1 -1
  15. package/build/js/basket.min.js +1 -1
  16. package/build/js/bundle.min.js +1 -1
  17. package/build/js/checkout.min.js +1 -1
  18. package/build/js/emulation.min.js +340 -110
  19. package/build/js/general.bundle.min.js +1 -1
  20. package/build/js/merged-checkout.min.js +1 -1
  21. package/build/js/page/components/store-locator-cards.js +76 -0
  22. package/build/js/pdp.bundle.min.js +1 -1
  23. package/build/js/plp.bundle.min.js +1 -1
  24. package/build/js/project-list.min.js +1 -1
  25. package/build/js/store-locator-cards.min.js +1 -0
  26. package/package.json +1 -1
  27. package/src/components/card-store-locator.hbs +70 -33
  28. package/src/components/card_bloomreach_media_banner.hbs +10 -0
  29. package/src/components/card_sponsor_banner.hbs +1 -1
  30. package/src/data/data_locators.json +441 -135
  31. package/src/data/data_search-results_v2.json +11 -0
  32. package/src/js/components/general/accordion.js +25 -2
  33. package/src/js/emulation/banner-placement-manager.js +235 -34
  34. package/src/js/emulation/gift-cards.js +1 -1
  35. package/src/js/emulation/store-locator-load-more.js +69 -0
  36. package/src/js/page/components/store-locator-cards.js +76 -0
  37. package/src/page_plp_bloomreach.html +81 -0
  38. package/src/page_plp_v2.html +5 -0
  39. package/src/page_store-locator-list.html +18 -28
  40. package/src/scss/components/_card-store-locator.scss +139 -32
  41. package/src/scss/components/card-product-banner.scss +35 -35
  42. package/src/scss/components/special-opening-schedule-v2.scss +2 -6
  43. package/src/scss/components/special-opening-schedule.scss +17 -4
  44. package/src/scss/emulation.scss +0 -6
  45. package/src/scss/pages/page_store-locator.scss +48 -26
  46. package/src/scss/store-locator-main.scss +15 -1
  47. package/src/sitemap.html +1 -0
  48. package/src/js/emulation/store-locator-list.js +0 -19
@@ -0,0 +1,76 @@
1
+ var Wick = window.Wick || (window.Wick = {});
2
+
3
+ Wick.StoreCardsAlign = (function () {
4
+ const SELECTORS = {
5
+ card: '.card-store',
6
+ info: '.card-store__info',
7
+ accordionHeader: '.opening-times-accordion__header',
8
+ };
9
+
10
+ let resizeTimeout;
11
+
12
+ function alignCardInfoHeights() {
13
+ const rows = [];
14
+
15
+ $(SELECTORS.card).each(function () {
16
+ const $card = $(this);
17
+ const top = $card.offset().top;
18
+
19
+ let row = rows.find((r) => Math.abs(r.top - top) < 5);
20
+
21
+ if (!row) {
22
+ row = { top: top, items: [] };
23
+ rows.push(row);
24
+ }
25
+
26
+ row.items.push($card);
27
+ });
28
+
29
+ rows.forEach((row) => {
30
+ let maxHeight = 0;
31
+
32
+ // reset
33
+ row.items.forEach(($card) => {
34
+ $card.find(SELECTORS.info).css('min-height', '');
35
+ });
36
+
37
+ // find max
38
+ row.items.forEach(($card) => {
39
+ const h = $card.find(SELECTORS.info).outerHeight();
40
+ if (h > maxHeight) maxHeight = h;
41
+ });
42
+
43
+ // apply
44
+ row.items.forEach(($card) => {
45
+ $card.find(SELECTORS.info).css('min-height', maxHeight + 'px');
46
+ });
47
+ });
48
+ }
49
+
50
+ function bindEvents() {
51
+ // load
52
+ $(window).on('load', alignCardInfoHeights);
53
+
54
+ // resize
55
+ $(window).on('resize', () => {
56
+ clearTimeout(resizeTimeout);
57
+ resizeTimeout = setTimeout(alignCardInfoHeights, 100);
58
+ });
59
+
60
+ // accordion
61
+ $(document).on('click', SELECTORS.accordionHeader, () => {
62
+ setTimeout(alignCardInfoHeights, 0);
63
+ });
64
+ }
65
+
66
+ function init() {
67
+ bindEvents();
68
+ }
69
+
70
+ init();
71
+
72
+ return {
73
+ init: init,
74
+ align: alignCardInfoHeights,
75
+ };
76
+ })();