wickes-css2 2.103.0-gift-cards.17 → 2.103.0-lg-788-no-extra-req-empty-cart.1
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/Readme.md +2 -1
- package/build/css/category-main.css +1 -1
- package/build/css/components/checkout-payment-details-v2.css +1 -1
- package/build/css/homepage-main.css +1 -1
- package/build/css/kitchen-plp-main.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/my-account-main-v2.css +1 -1
- package/build/css/my-account-main.css +1 -1
- package/build/css/pages/page_checkout_delivery-new.css +1 -1
- package/build/css/pages/page_product-details-v2.css +1 -1
- package/build/css/pdp-main-before-combine.css +1 -1
- package/build/css/pdp-main-non-critical.css +1 -1
- package/build/css/pdp-main.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/css/store-locator-main.css +1 -1
- package/build/js/account-members.min.js +1 -1
- package/build/js/add-project-list-id.min.js +1 -1
- package/build/js/address-book.min.js +1 -1
- package/build/js/basket.min.js +2 -2
- package/build/js/bundle.min.js +1 -1
- package/build/js/change-password.min.js +1 -1
- package/build/js/checkout.min.js +2 -2
- package/build/js/emulation.min.js +970 -282
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/merged-checkout.min.js +2 -2
- package/build/js/mini-basket-slider.min.js +1 -0
- package/build/js/page/basket/basket-update-cart-action.js +59 -0
- package/build/js/page/basket/basket-update-cart.js +29 -0
- package/build/js/page/basket/basket-utils.js +50 -0
- package/build/js/page/basket/mini-basket-total.js +97 -0
- package/build/js/page/basket/quantity-change-handler.js +64 -0
- package/build/js/page/basket/update-quantity-operation.js +37 -0
- package/build/js/page/basket/update-quantity.js +65 -0
- package/build/js/page/basket-v2.js +138 -244
- package/build/js/page/components/discounts.js +6 -6
- package/build/js/page/components/mini-basket-slider.js +569 -0
- package/build/js/page/components/order-summary.js +25 -42
- package/build/js/page/utils/validation.js +1 -46
- package/build/js/pdp.bundle.min.js +1 -1
- package/build/js/personal-details.min.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -44
- package/build/js/quiz.min.js +1 -1
- package/build/js/track-my-order.min.js +1 -1
- package/package.json +2 -2
- package/src/components/checkout-payment-details-v2.hbs +11 -10
- package/src/components/checkout_payment-new.hbs +4 -1
- package/src/components/checkout_payment-other-methods.hbs +4 -1
- package/src/components/mini-basket/mini-basket-empty.hbs +3 -13
- package/src/components/mini-basket/mini-basket-order-item.hbs +73 -0
- package/src/components/mini-basket/mini-basket.hbs +32 -13
- package/src/components/mini-basket/product-item.hbs +37 -16
- package/src/components/payments-checkout-v2.hbs +7 -2
- package/src/components/payments-checkout.hbs +6 -1
- package/src/components/payments.hbs +5 -1
- package/src/components/table_order-details-klarna.hbs +1 -1
- package/src/components/table_payment.hbs +4 -1
- package/src/data/data_confirmation-summary.json +4 -2
- package/src/data/data_mini-basket.json +4 -80
- package/src/data/data_wismo.json +1 -1
- package/src/elements/form-row.hbs +1 -1
- package/src/elements/input.hbs +2 -31
- package/src/js/components/general/cart-slider.js +4 -0
- package/src/js/components/general/create-popup-slider.js +5 -2
- package/src/js/components/general/notification.js +1 -2
- package/src/js/components/toggle-password-visibility.js +58 -0
- package/src/js/emulation/checkout-payment-details.js +14 -23
- package/src/js/emulation/custom-slider-emulation.js +4 -10
- package/src/js/emulation/forms.js +2 -7
- package/src/js/emulation/mini-basket-data.js +949 -0
- package/src/js/page/basket/basket-update-cart-action.js +59 -0
- package/src/js/page/basket/basket-update-cart.js +29 -0
- package/src/js/page/basket/basket-utils.js +50 -0
- package/src/js/page/basket/mini-basket-total.js +97 -0
- package/src/js/page/basket/quantity-change-handler.js +64 -0
- package/src/js/page/basket/update-quantity-operation.js +37 -0
- package/src/js/page/basket/update-quantity.js +65 -0
- package/src/js/page/basket-v2.js +138 -244
- package/src/js/page/components/discounts.js +6 -6
- package/src/js/page/components/mini-basket-slider.js +569 -0
- package/src/js/page/components/order-summary.js +25 -42
- package/src/js/page/utils/validation.js +1 -46
- package/src/layouts/base.hbs +0 -6
- package/src/layouts/checkout.hbs +5 -1
- package/src/page_checkout_payment-details_guest-with-checkout-journey.html +1 -1
- package/src/page_my-account_change-password.html +0 -1
- package/src/page_my-order.html +1 -1
- package/src/page_payment-details-with-clearpay.html +2 -2
- package/src/page_payment-details-with-gift-card.html +5 -8
- package/src/page_shopping-cart-v2.html +2 -2
- package/src/page_split-orders-klarna.html +106 -0
- package/src/partials/scripts.hbs +1 -0
- package/src/scss/components/_custom-slider.scss +131 -3
- package/src/scss/components/_popover-mini-basket.scss +0 -4
- package/src/scss/components/checkout-payment-details-v2.scss +0 -2
- package/src/scss/pages/page_checkout_delivery-new.scss +0 -26
- package/src/scss/pages/page_product-details-v2.scss +0 -4
- package/src/sitemap.html +6 -0
- package/build/img/giftcard.svg +0 -28
- package/build/img/klarna.svg +0 -10
- package/build/img/payment/checkout/klarna.svg +0 -10
- package/build/img/payment/footer/klarna.svg +0 -10
- package/build/js/gift-cards.min.js +0 -1
- package/build/js/page/components/gift-cards.js +0 -894
- package/build/js/page/components/toggle-password-visibility.js +0 -22
- package/build/js/page/utils/gift-cards-utils.js +0 -170
- package/build/js/page/utils/input-handling.js +0 -92
- package/build/js/page/utils/show-hide-input.js +0 -28
- package/build/js/toggle-password-visibility.min.js +0 -1
- package/src/components/gift-cards-hint.hbs +0 -9
- package/src/components/gift-cards.hbs +0 -90
- package/src/components/giftcard-chip.hbs +0 -23
- package/src/components/giftcard-summary.hbs +0 -6
- package/src/img/giftcard.svg +0 -28
- package/src/img/klarna.svg +0 -10
- package/src/img/payment/checkout/klarna.svg +0 -10
- package/src/img/payment/footer/klarna.svg +0 -10
- package/src/js/components/general/mini-basket-slider.js +0 -8
- package/src/js/emulation/checkout-data.js +0 -35
- package/src/js/emulation/gift-cards.js +0 -205
- package/src/js/page/components/gift-cards.js +0 -894
- package/src/js/page/components/toggle-password-visibility.js +0 -22
- package/src/js/page/utils/gift-cards-utils.js +0 -170
- package/src/js/page/utils/input-handling.js +0 -92
- package/src/js/page/utils/show-hide-input.js +0 -28
- package/src/scss/components/_gift-cards.scss +0 -360
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"number": 0,
|
|
4
4
|
"products": [
|
|
5
5
|
{
|
|
6
|
+
"id": 1,
|
|
6
7
|
"quantity": {
|
|
7
8
|
"value": "1"
|
|
8
9
|
},
|
|
@@ -15,87 +16,9 @@
|
|
|
15
16
|
"CC": "East Grinstead"
|
|
16
17
|
},
|
|
17
18
|
{
|
|
19
|
+
"id": 2,
|
|
18
20
|
"quantity": {
|
|
19
|
-
"value": "
|
|
20
|
-
},
|
|
21
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim",
|
|
22
|
-
"src": "img/placeholders/[e-img-4to3].jpg",
|
|
23
|
-
"price": "£2,009.00",
|
|
24
|
-
"incVatPrice": "£309.00",
|
|
25
|
-
"excVatPrice": "£109.00",
|
|
26
|
-
"bad-amount": true
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"quantity": {
|
|
30
|
-
"value": "1"
|
|
31
|
-
},
|
|
32
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim",
|
|
33
|
-
"src": "img/placeholders/[e-img-4to3].jpg",
|
|
34
|
-
"price": "£2,009.00",
|
|
35
|
-
"incVatPrice": "£309.00",
|
|
36
|
-
"excVatPrice": "£109.00",
|
|
37
|
-
"bad-amount": true
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"quantity": {
|
|
41
|
-
"value": "1"
|
|
42
|
-
},
|
|
43
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim",
|
|
44
|
-
"src": "img/placeholders/tap.jpg",
|
|
45
|
-
"price": "£2,009.00",
|
|
46
|
-
"incVatPrice": "£30.00",
|
|
47
|
-
"excVatPrice": "£10.00",
|
|
48
|
-
"lower-quantity": true,
|
|
49
|
-
"CC": "East Grinstead"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"quantity": {
|
|
53
|
-
"value": "1"
|
|
54
|
-
},
|
|
55
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim",
|
|
56
|
-
"src": "img/placeholders/[e-img-4to3].jpg",
|
|
57
|
-
"price": "£2,009.00",
|
|
58
|
-
"incVatPrice": "£309.00",
|
|
59
|
-
"excVatPrice": "£109.00",
|
|
60
|
-
"bad-amount": true
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"quantity": {
|
|
64
|
-
"value": "1"
|
|
65
|
-
},
|
|
66
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim",
|
|
67
|
-
"src": "img/placeholders/[e-img-4to3].jpg",
|
|
68
|
-
"price": "£2,009.00",
|
|
69
|
-
"incVatPrice": "£309.00",
|
|
70
|
-
"excVatPrice": "£109.00",
|
|
71
|
-
"bad-amount": true
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"quantity": {
|
|
75
|
-
"value": "1"
|
|
76
|
-
},
|
|
77
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim",
|
|
78
|
-
"src": "img/placeholders/tap.jpg",
|
|
79
|
-
"price": "£2,009.00",
|
|
80
|
-
"incVatPrice": "£30.00",
|
|
81
|
-
"excVatPrice": "£10.00",
|
|
82
|
-
"lower-quantity": true,
|
|
83
|
-
"CC": "East Grinstead"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"quantity": {
|
|
87
|
-
"value": "1"
|
|
88
|
-
},
|
|
89
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim",
|
|
90
|
-
"src": "img/placeholders/[e-img-4to3].jpg",
|
|
91
|
-
"price": "£2,009.00",
|
|
92
|
-
"incVatPrice": "£309.00",
|
|
93
|
-
"excVatPrice": "£109.00",
|
|
94
|
-
"bad-amount": true
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"quantity": {
|
|
98
|
-
"value": "1"
|
|
21
|
+
"value": "5"
|
|
99
22
|
},
|
|
100
23
|
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim",
|
|
101
24
|
"src": "img/placeholders/[e-img-4to3].jpg",
|
|
@@ -125,3 +48,4 @@
|
|
|
125
48
|
}
|
|
126
49
|
}
|
|
127
50
|
}
|
|
51
|
+
|
package/src/data/data_wismo.json
CHANGED
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"name": "Payment details:",
|
|
67
|
-
"value": "<div class='klarna-logo-img mt-1'><
|
|
67
|
+
"value": "<div class='klarna-logo-img mt-1'><klarna-placement data-key='sidebar-promotion-auto-size' data-locale='en-GB'></klarna-placement></div>"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"name": "Voucher:",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="form-row {{#if clearInput}}form-row--clear-input{{/if}} {{#if error}}form-row_validation-error{{/if}} {{#if locked}}form-row--locked{{/if}} {{row-mod}}" {{#if required}}data-row-required{{/if}} {{#if clearInput}}data-clearable{{/if}} {{#if showContent}}data-show-content{{/if}}
|
|
1
|
+
<div class="form-row {{#if clearInput}}form-row--clear-input{{/if}} {{#if error}}form-row_validation-error{{/if}} {{#if locked}}form-row--locked{{/if}} {{row-mod}}" {{#if required}}data-row-required{{/if}} {{#if clearInput}}data-clearable{{/if}} {{#if showContent}}data-show-content{{/if}} data-form-field>
|
|
2
2
|
<label class="form-row__label {{#if required}}form-row__label_required{{/if}} {{#if label-hidden}}sr-only{{/if}}" for="{{id}}">
|
|
3
3
|
{{label}}
|
|
4
4
|
{{#if tooltip}}
|
package/src/elements/input.hbs
CHANGED
|
@@ -1,36 +1,7 @@
|
|
|
1
1
|
{{#if textarea}}
|
|
2
2
|
<textarea class="tbx {{#if textarea}}tbx_textarea{{/if}} {{#if error}}tbx_error{{/if}}" rows="{{textareaRows}}" cols="{{textareaCols}}" value="{{value}}" maxlength="{{maxlength}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" {{#if disabled}}disabled{{/if}}></textarea>
|
|
3
3
|
{{else if type}}
|
|
4
|
-
<input
|
|
5
|
-
type="{{type}}"
|
|
6
|
-
class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}"
|
|
7
|
-
value="{{value}}"
|
|
8
|
-
id="{{id}}"
|
|
9
|
-
name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}"
|
|
10
|
-
placeholder="{{placeholder}}"
|
|
11
|
-
{{#if (or locked disabled)}}disabled{{/if}}
|
|
12
|
-
{{#if need-pattern}}pattern=""{{/if}}
|
|
13
|
-
{{#if readonly}}readonly{{/if}}
|
|
14
|
-
{{#if data-tag}}data-tag="{{data-tag}}"{{/if}}
|
|
15
|
-
{{#if maxlength}}maxlength="{{maxlength}}"{{/if}}
|
|
16
|
-
{{#if inputmode}}inputmode="{{inputmode}}"{{/if}}
|
|
17
|
-
{{#if autocomplete}}autocomplete="{{autocomplete}}"{{/if}}
|
|
18
|
-
>
|
|
4
|
+
<input type="{{type}}" class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}" value="{{value}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" placeholder="{{placeholder}}" {{#if (or locked disabled)}}disabled{{/if}} {{#if need-pattern}}pattern=""{{/if}} {{#if readonly}}readonly{{/if}} {{#if data-tag}}data-tag="{{data-tag}}"{{/if}}>
|
|
19
5
|
{{else}}
|
|
20
|
-
<input
|
|
21
|
-
type="text"
|
|
22
|
-
class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}"
|
|
23
|
-
value="{{value}}"
|
|
24
|
-
id="{{id}}"
|
|
25
|
-
name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}"
|
|
26
|
-
placeholder="{{placeholder}}"
|
|
27
|
-
{{#if (or locked disabled)}}disabled{{/if}}
|
|
28
|
-
{{#if need-pattern}}pattern=""{{/if}}
|
|
29
|
-
{{#if readonly}}readonly{{/if}}
|
|
30
|
-
{{#if data-tag}}data-tag="{{data-tag}}"{{/if}}
|
|
31
|
-
{{#if error}}aria-invalid="true"{{/if}}
|
|
32
|
-
{{#if maxlength}}maxlength="{{maxlength}}"{{/if}}
|
|
33
|
-
{{#if inputmode}}inputmode="{{inputmode}}"{{/if}}
|
|
34
|
-
{{#if autocomplete}}autocomplete="{{autocomplete}}"{{/if}}
|
|
35
|
-
>
|
|
6
|
+
<input type="text" class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}" value="{{value}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" placeholder="{{placeholder}}" {{#if (or locked disabled)}}disabled{{/if}} {{#if need-pattern}}pattern=""{{/if}} {{#if readonly}}readonly{{/if}} {{#if data-tag}}data-tag="{{data-tag}}"{{/if}}>
|
|
36
7
|
{{/if}}
|
|
@@ -11,6 +11,10 @@ createPopupSlider({
|
|
|
11
11
|
const htmlContent = event.detail.html;
|
|
12
12
|
$(el.slider).append(htmlContent);
|
|
13
13
|
showSlider();
|
|
14
|
+
Wick.MiniBasketSliderFE.isMiniBasketLoaded = false;
|
|
14
15
|
$(el.sliderWrap).on('scroll', _.debounce(() => handleScroll(el.sliderWrap), 100));
|
|
15
16
|
},
|
|
17
|
+
onClose: function () {
|
|
18
|
+
Wick.MiniBasketSliderFE.cartEntries = [];
|
|
19
|
+
}
|
|
16
20
|
});
|
|
@@ -8,7 +8,7 @@ function createEvent(eventName, payload, eventDetail) {
|
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function createPopupSlider({ type, sliderSelector, onAppendEvent, onAppend }) {
|
|
11
|
+
function createPopupSlider({ type, sliderSelector, onAppendEvent, onAppend, onClose }) {
|
|
12
12
|
const events = {
|
|
13
13
|
CLOSE_JUST_ADDED: 'CLOSE_JUST_ADDED',
|
|
14
14
|
CLOSE_MINI_BASKET: 'CLOSE_MINI_BASKET'
|
|
@@ -119,6 +119,9 @@ function createPopupSlider({ type, sliderSelector, onAppendEvent, onAppend }) {
|
|
|
119
119
|
.finally(() => {
|
|
120
120
|
hideSlider();
|
|
121
121
|
Wick.Backdrop.hide();
|
|
122
|
+
if (typeof onClose === 'function') {
|
|
123
|
+
onClose();
|
|
124
|
+
}
|
|
122
125
|
})
|
|
123
126
|
}
|
|
124
127
|
|
|
@@ -167,7 +170,7 @@ function createPopupSlider({ type, sliderSelector, onAppendEvent, onAppend }) {
|
|
|
167
170
|
bindClosePopup();
|
|
168
171
|
|
|
169
172
|
if (onAppendEvent && onAppend) {
|
|
170
|
-
|
|
173
|
+
window.addEventListener(onAppendEvent, (event) => {
|
|
171
174
|
onAppend(event, { showSlider, handleScroll, el });
|
|
172
175
|
});
|
|
173
176
|
}
|
|
@@ -4,14 +4,13 @@ Wick.Notification = (function(){
|
|
|
4
4
|
var self = this,
|
|
5
5
|
iconSuccess = '<span class="icon notification__icon"><span class="fas fa-check-circle"></span></span>',
|
|
6
6
|
iconWarning = '<span class="icon notification__icon"><span class="fas fa-exclamation-circle"></span></span>',
|
|
7
|
-
iconError = '<span class="icon notification__icon"><span class="fas fa-times-circle"></span></span>',
|
|
8
7
|
closeBtn = '<span class="icon notification__close"><span class="far fa-times"></span></span>';
|
|
9
8
|
|
|
10
9
|
this.$self = $('<div/>', {
|
|
11
10
|
'class': 'notification notification_general notification_' + params.type,
|
|
12
11
|
html: params.text
|
|
13
12
|
})
|
|
14
|
-
.prepend(params.type === 'success' ? iconSuccess : params.type === 'warning' ? iconWarning : params.type === 'error' ?
|
|
13
|
+
.prepend(params.type === 'success' ? iconSuccess : params.type === 'warning' ? iconWarning : params.type === 'error' ? iconWarning : '')
|
|
15
14
|
.prepend(params.closeBtn ? closeBtn : '')
|
|
16
15
|
.prependTo(params.container);
|
|
17
16
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var Wick = window.Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.TogglePasswordVisibility = {
|
|
4
|
+
el: {
|
|
5
|
+
$toggleShow: $('[data-show-content] .toggle-show'),
|
|
6
|
+
inputWrap: $('.form-row[data-show-content] .input-wrap'),
|
|
7
|
+
toggleIcon: '.toggle-show',
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
updateIconVisibility(inputField, toggleIcon) {
|
|
11
|
+
const valueLength = inputField.val().length;
|
|
12
|
+
if (valueLength > 0) {
|
|
13
|
+
toggleIcon.show();
|
|
14
|
+
} else {
|
|
15
|
+
toggleIcon.hide();
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
attachInputListener(inputField, toggleIcon) {
|
|
20
|
+
inputField.on('input', function () {
|
|
21
|
+
Wick.TogglePasswordVisibility.updateIconVisibility($(this), toggleIcon);
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
attachToggleClickListener(inputField, toggleIcon) {
|
|
26
|
+
toggleIcon.on('click', function () {
|
|
27
|
+
const isPasswordType = inputField.attr('type') === 'password';
|
|
28
|
+
const iconSvg = $(this).find('svg');
|
|
29
|
+
|
|
30
|
+
if (isPasswordType) {
|
|
31
|
+
inputField.attr('type', 'text');
|
|
32
|
+
iconSvg.removeClass('fa-eye-slash').addClass('fa-eye');
|
|
33
|
+
} else {
|
|
34
|
+
inputField.attr('type', 'password');
|
|
35
|
+
iconSvg.removeClass('fa-eye').addClass('fa-eye-slash');
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
init() {
|
|
41
|
+
Wick.TogglePasswordVisibility.el.inputWrap.each(function () {
|
|
42
|
+
const inputField = $(this).find('input');
|
|
43
|
+
const toggleIcon = $(this).find(Wick.TogglePasswordVisibility.el.toggleIcon);
|
|
44
|
+
|
|
45
|
+
Wick.TogglePasswordVisibility.attachInputListener(inputField, toggleIcon);
|
|
46
|
+
Wick.TogglePasswordVisibility.updateIconVisibility(inputField, toggleIcon);
|
|
47
|
+
Wick.TogglePasswordVisibility.attachToggleClickListener(inputField, toggleIcon);
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
$(document).ready(function () {
|
|
53
|
+
if (!Wick.TogglePasswordVisibility.el.$toggleShow.length) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Wick.TogglePasswordVisibility.init();
|
|
58
|
+
});
|
|
@@ -2,33 +2,24 @@ var Wick = Wick || {};
|
|
|
2
2
|
|
|
3
3
|
Wick.PaymentDetails = (function () {
|
|
4
4
|
var $btnEnterDetails = $('.btn-enter-details'),
|
|
5
|
+
$form = $btnEnterDetails.parents('form'),
|
|
5
6
|
isGuestPage = $('.page_checkout-payment-details_guest').length;
|
|
6
7
|
|
|
7
8
|
function bindEvents () {
|
|
8
|
-
$btnEnterDetails.on('click', function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var addressManualOk = manualLine1 && manualTown && manualPost;
|
|
20
|
-
|
|
21
|
-
if (nameVal && (addressFinderOk || addressManualOk)) {
|
|
22
|
-
var $details = $('.checkout-payment-details__card-details');
|
|
23
|
-
$details.removeClass('checkout-payment-details__card-details_hidden');
|
|
24
|
-
$('html, body').animate({ scrollTop: $details.offset().top - 15 }, 700);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var formEl = $scope.closest('form').get(0) || $scope.get(0);
|
|
29
|
-
if (formEl && Wick.Forms && Wick.Forms.showValidationErrors) {
|
|
30
|
-
Wick.Forms.showValidationErrors(formEl);
|
|
9
|
+
$btnEnterDetails.on('click', function(){
|
|
10
|
+
if ($form.find('#card-name').val().length &&
|
|
11
|
+
$form.find('#first-line-address').val().length &&
|
|
12
|
+
$form.find('#address-line-1').val().length &&
|
|
13
|
+
$form.find('#town-city').val().length &&
|
|
14
|
+
$form.find('#postcode_additional').val().length){
|
|
15
|
+
$('.checkout-payment-details__card-details').removeClass('checkout-payment-details__card-details_hidden');
|
|
16
|
+
$('html, body').animate({
|
|
17
|
+
scrollTop: $('.checkout-payment-details__card-details').offset().top - 15
|
|
18
|
+
}, 700);
|
|
19
|
+
return false;
|
|
31
20
|
}
|
|
21
|
+
Wick.Forms.showValidationErrors($form[0]);
|
|
22
|
+
return false;
|
|
32
23
|
});
|
|
33
24
|
|
|
34
25
|
$('.checkout-payment-details__card-details').on('submit', function(){
|
|
@@ -7,22 +7,16 @@ function simulateHybrisSendingHtml() {
|
|
|
7
7
|
document.dispatchEvent(event);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
function
|
|
11
|
-
$(window).on('
|
|
10
|
+
function bindResolveEvent(events) {
|
|
11
|
+
$(window).on(events.join(' '), function ({ detail: { resolve } }) {
|
|
12
12
|
setTimeout(() => {
|
|
13
|
-
|
|
13
|
+
resolve();
|
|
14
14
|
}, 200);
|
|
15
15
|
});
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
function simulateShowMiniBasket() {
|
|
19
|
-
const event = new CustomEvent('showMiniBasket', {});
|
|
20
|
-
document.dispatchEvent(event);
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
$(document).ready(function () {
|
|
24
19
|
$('.btn-add-to-basket').on('click', simulateHybrisSendingHtml);
|
|
25
|
-
$('.header-minicart__btn').on('click', simulateShowMiniBasket);
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
bindResolveEvent(['CLOSE_JUST_ADDED', 'CLOSE_MINI_BASKET', 'MINI_BASKET_CHECKOUT', 'MINI_BASKET_VIEW_BASKET']);
|
|
28
22
|
});
|
|
@@ -60,16 +60,11 @@ Wick.Forms = (function(){
|
|
|
60
60
|
|
|
61
61
|
var showValidationErrors = function (form, errorMsg) {
|
|
62
62
|
var $form = $(form);
|
|
63
|
-
var $rows = $form.find(fieldRow).not('[data-no-global-validation]');
|
|
64
|
-
if (!$rows.length) return;
|
|
65
|
-
$rows.find('.form-row__error').remove();
|
|
66
|
-
|
|
67
63
|
if (!$form.hasClass(formInvalid)) {
|
|
68
|
-
$form.
|
|
64
|
+
$form.find('.form-row__error').remove();
|
|
65
|
+
$form.addClass(formInvalid).find(fieldRow).append(validationError(errorMsg)).addClass(rowValidationError);
|
|
69
66
|
}
|
|
70
67
|
|
|
71
|
-
$rows.append(validationError(errorMsg)).addClass(rowValidationError);
|
|
72
|
-
|
|
73
68
|
var $firstMsg = $form.find(fieldRow).first();
|
|
74
69
|
if($firstMsg.length && !isElementInViewport($firstMsg)){
|
|
75
70
|
var inModal = $firstMsg.closest('.modal').length,
|