wickes-css2 2.94.0-develop.1 → 2.94.0-develop.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wickes-css2",
3
- "version": "2.94.0-develop.1",
3
+ "version": "2.94.0-develop.2",
4
4
  "description": "CSS and JS and page templates in use by Wickes",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -36,7 +36,11 @@ Wick.VatToggle = {
36
36
  },
37
37
 
38
38
  getSwitcherState: function() {
39
- return !!$(Wick.VatToggle.el.switchVatInput).attr('checked');
39
+ if ($(Wick.VatToggle.el.switchVatInput).length) {
40
+ return !!$(Wick.VatToggle.el.switchVatInput).attr('checked');
41
+ } else {
42
+ return null;
43
+ }
40
44
  },
41
45
 
42
46
  createToggleEvent: function(isToggled) {
@@ -65,6 +69,28 @@ Wick.VatToggle = {
65
69
  $(includingVatEl).toggleClass(hiddenClassName);
66
70
  $(excludingVat).toggleClass(hiddenClassName);
67
71
  },
72
+ reapplyDisplayClass: function () {
73
+ const includingVatEl = Wick.VatToggle.el.includingVat;
74
+ const excludingVatEl = Wick.VatToggle.el.excludingVat;
75
+ const hiddenClassName = Wick.VatToggle.HIDDEN_CLASS_NAME;
76
+
77
+ let vatState = null;
78
+
79
+ // check switcher state for web or cookie for app
80
+ if (Wick.VatToggle.getSwitcherState() !== null) {
81
+ vatState = Wick.VatToggle.getSwitcherState();
82
+ } else {
83
+ vatState = Wick.VatToggle.isOn();
84
+ }
85
+
86
+ if (vatState) {
87
+ $(includingVatEl).addClass(hiddenClassName);
88
+ $(excludingVatEl).removeClass(hiddenClassName);
89
+ } else {
90
+ $(includingVatEl).removeClass(hiddenClassName);
91
+ $(excludingVatEl).addClass(hiddenClassName);
92
+ }
93
+ },
68
94
 
69
95
  updateGlobalClass: function () {
70
96
  const includingVatGlobal = Wick.VatToggle.el.includingVatGlobalClass;
@@ -38,6 +38,7 @@ Wick.PLPLoadMore = {
38
38
 
39
39
  Wick.PLPLoadMore.showNewCards(response);
40
40
  Wick.PLPLoadMore.toggleLoadMoreBtn();
41
+ Wick.VatToggle.reapplyDisplayClass();
41
42
  })
42
43
  .finally(() => {
43
44
  hideLoader(Wick.PLPLoadMore.el.loader);
@@ -1,4 +1,4 @@
1
- {{#extend "my-account" pageClass="wismo-hist" title="Wismo Order history" }}
1
+ {{#extend "my-account" pageClass="wismo-hist" title="Wismo Order history" switch-vat=true}}
2
2
  {{#content "head" mode="append"}}
3
3
  <link type="text/css" rel="stylesheet" href="./css/pages/page_wismo-order-history.css">
4
4
  {{/content}}
@@ -12,7 +12,7 @@
12
12
 
13
13
  {{> form-row row-mod="sort-order-by" dropdown="true" label="Sort by" id="d1" placeholder="Date"}}
14
14
  {{#each page_wismo-order-history.orders }}
15
- {{> table_wismo-history }}
15
+ {{> table_wismo-history switch-vat=true }}
16
16
  {{/each }}
17
17
  <div class="load-more-wrap" id="loadmorewrap">
18
18
  <button class="btn btn-primary load-more" id="loadmore">Load more</button>
@@ -21,4 +21,4 @@
21
21
  </div>
22
22
  </div>
23
23
  {{/content}}
24
- {{/extend}}
24
+ {{/extend}}
package/src/sitemap.html CHANGED
@@ -348,7 +348,7 @@
348
348
  <li>
349
349
  <span class="page-id">4.10</span>
350
350
  <a href="page_wismo-order-history-loadmore.html" target="_blank">
351
- Wismo Order history - Loadmore
351
+ Wismo Order history - Loadmore VAT
352
352
  </a>
353
353
  </li>
354
354
  <li>