wickes-css2 2.103.0-RG-1742-billie-30-60-90-days.3 → 2.103.0-develop.10
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 +5 -1
- package/build/css/category-main.css +1 -1
- package/build/css/components/card-product-banner.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_products-list-combined.css +1 -1
- package/build/css/pages/page_products-list.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/basket.min.js +2 -2
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +2 -2
- package/build/js/emulation.min.js +1301 -369
- 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/checkout-payment-details.js +43 -96
- package/build/js/page/components/discounts.js +6 -6
- package/build/js/page/components/mini-basket-slider.js +569 -0
- package/build/js/page/plp-cards-v2.js +15 -6
- package/build/js/page/plp-load-more.js +1 -1
- package/build/js/pdp.bundle.min.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/package.json +18 -3
- package/src/components/card_product_v2.hbs +10 -5
- package/src/components/card_sponsor_banner.hbs +8 -0
- package/src/components/card_sponsor_product.hbs +6 -0
- package/src/components/checkout-payment-details-v2.hbs +23 -35
- package/src/components/injected-content.hbs +1 -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/srp-injected.hbs +3 -13
- package/src/data/data_confirmation-summary.json +4 -2
- package/src/data/data_mini-basket.json +4 -80
- package/src/data/data_search-results_v2.json +56 -141
- package/src/js/components/banner-placement-manager.js +267 -0
- package/src/js/components/general/cart-slider.js +4 -0
- package/src/js/components/general/create-popup-slider.js +5 -2
- package/src/js/emulation/account-hub.js +40 -40
- package/src/js/emulation/banner-placement-manager.js +53 -0
- package/src/js/emulation/checkout-payment-details.js +8 -8
- package/src/js/emulation/custom-slider-emulation.js +4 -10
- package/src/js/emulation/forms.js +89 -118
- package/src/js/emulation/mini-basket-data.js +949 -0
- package/src/js/emulation/paymentLoader.js +3 -4
- 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/checkout-payment-details.js +43 -96
- package/src/js/page/components/discounts.js +6 -6
- package/src/js/page/components/mini-basket-slider.js +569 -0
- package/src/js/page/plp-cards-v2.js +15 -6
- package/src/js/page/plp-load-more.js +1 -1
- package/src/layouts/base.hbs +0 -6
- package/src/page_plp_v2.html +17 -6
- package/src/page_search-results.html +12 -2
- package/src/partials/scripts.hbs +1 -0
- package/src/scss/category-main.scss +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/card-product-banner.scss +91 -3
- package/src/scss/emulation.scss +3 -3
- package/src/scss/helpers/_colors-semantic.scss +120 -0
- package/src/scss/helpers/_variables.scss +2 -0
- package/src/scss/main.scss +0 -2
- package/src/scss/pages/_facets.scss +86 -0
- package/src/scss/pages/page_products-list-combined.scss +11 -0
- package/src/scss/pages/page_products-list.scss +8 -0
- package/src/scss/plp-main.scss +1 -0
- package/build/css/components/checkout-chip.css +0 -1
- package/build/css/components/checkout-payment-repayment-terms.css +0 -1
- package/src/components/checkout-chip.hbs +0 -15
- package/src/components/checkout-payment-repayment-terms.hbs +0 -12
- package/src/data/data_billie-terms.json +0 -7
- package/src/js/components/general/mini-basket-slider.js +0 -8
- package/src/js/components/product-banner.js +0 -148
- package/src/js/emulation/repayment-toggle.js +0 -35
- package/src/scss/components/checkout-chip.scss +0 -64
- package/src/scss/components/checkout-payment-repayment-terms.scss +0 -39
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var Wick = Wick || {};
|
|
2
2
|
|
|
3
|
-
Wick.PaymentDetails = (function() {
|
|
3
|
+
Wick.PaymentDetails = (function () {
|
|
4
4
|
var $btnEnterDetails = $('.btn-enter-details'),
|
|
5
5
|
$form = $btnEnterDetails.parents('form'),
|
|
6
6
|
isGuestPage = $('.page_checkout-payment-details_guest').length;
|
|
7
7
|
|
|
8
|
-
function bindEvents() {
|
|
9
|
-
$btnEnterDetails.on('click', function()
|
|
10
|
-
if ($form.find('#card-name').val()
|
|
8
|
+
function bindEvents () {
|
|
9
|
+
$btnEnterDetails.on('click', function(){
|
|
10
|
+
if ($form.find('#card-name').val().length &&
|
|
11
11
|
$form.find('#first-line-address').val().length &&
|
|
12
12
|
$form.find('#address-line-1').val().length &&
|
|
13
13
|
$form.find('#town-city').val().length &&
|
|
14
|
-
$form.find('#postcode_additional').val().length)
|
|
14
|
+
$form.find('#postcode_additional').val().length){
|
|
15
15
|
$('.checkout-payment-details__card-details').removeClass('checkout-payment-details__card-details_hidden');
|
|
16
16
|
$('html, body').animate({
|
|
17
|
-
scrollTop: $('.checkout-payment-details__card-details').offset().top - 15
|
|
17
|
+
scrollTop: $('.checkout-payment-details__card-details').offset().top - 15
|
|
18
18
|
}, 700);
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
@@ -22,14 +22,14 @@ Wick.PaymentDetails = (function() {
|
|
|
22
22
|
return false;
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
$('.checkout-payment-details__card-details').on('submit', function()
|
|
25
|
+
$('.checkout-payment-details__card-details').on('submit', function(){
|
|
26
26
|
var $form = $(this);
|
|
27
27
|
if ($form.find('#card-type').val() &&
|
|
28
28
|
$form.find('#card-name1').val().length &&
|
|
29
29
|
$form.find('#card-number').val().length &&
|
|
30
30
|
$form.find('#month').val() &&
|
|
31
31
|
$form.find('#year').val() &&
|
|
32
|
-
$form.find('#security-code').val())
|
|
32
|
+
$form.find('#security-code').val()){
|
|
33
33
|
window.location.href = isGuestPage
|
|
34
34
|
? './page_checkout_confirmation_guest.html'
|
|
35
35
|
: './page_checkout_confirmation.html';
|
|
@@ -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
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var Wick = Wick || {};
|
|
2
|
-
Wick.Forms = (function()
|
|
2
|
+
Wick.Forms = (function(){
|
|
3
3
|
var fieldRow = '.form-row[data-row-required]',
|
|
4
4
|
field = '.form-row__field',
|
|
5
5
|
fieldError = '.form-row__error',
|
|
@@ -9,44 +9,43 @@ Wick.Forms = (function() {
|
|
|
9
9
|
// validationError = '<div class="form-row__error">Error message here</div>',
|
|
10
10
|
$forgotPassword = $('.link-forgot-password'),
|
|
11
11
|
scenarios = [{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
condition: function(){
|
|
13
|
+
// fill in the valid returning customer's details
|
|
14
|
+
// Email: responsive@test.com; Password: 123456
|
|
15
|
+
return $('#login-email').val() === 'responsive@test.com' && $('#password').val() === '123456';
|
|
16
|
+
},
|
|
17
|
+
action: function(){
|
|
18
|
+
// redirected to the homepage
|
|
19
|
+
Wick.User.login();
|
|
20
|
+
window.location.href = './';
|
|
21
|
+
}
|
|
21
22
|
},
|
|
22
|
-
},
|
|
23
23
|
{
|
|
24
|
-
condition: function()
|
|
24
|
+
condition: function(){
|
|
25
25
|
// continue as a new user with "test+random@user.com"
|
|
26
26
|
return $('#registration-email').val().length;
|
|
27
27
|
// return $('#registration-email').val() === 'test+random@user.com';
|
|
28
28
|
},
|
|
29
|
-
action: function()
|
|
29
|
+
action: function(){
|
|
30
30
|
// redirected to the register form
|
|
31
31
|
window.location.href = './page_registration.html';
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
condition: function()
|
|
35
|
+
condition: function(){
|
|
36
36
|
// When I click forgotten password link
|
|
37
37
|
},
|
|
38
|
-
action: function()
|
|
38
|
+
action: function(){
|
|
39
39
|
// redirected on the "Forgotten Password" page
|
|
40
40
|
window.location.href = './page_forgotten-password.html';
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
|
|
45
|
-
validationError = function(errorMsg) {
|
|
46
|
-
return `<div class="form-row__error"> ${errorMsg || 'Error message here'}</div>`;
|
|
47
|
-
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
];
|
|
48
44
|
|
|
49
|
-
function
|
|
45
|
+
validationError = function (errorMsg) {
|
|
46
|
+
return `<div class="form-row__error"> ${errorMsg || 'Error message here'}</div>`
|
|
47
|
+
}
|
|
48
|
+
function isElementInViewport (el) {
|
|
50
49
|
if (typeof jQuery === 'function' && el instanceof jQuery) {
|
|
51
50
|
el = el[0];
|
|
52
51
|
}
|
|
@@ -59,21 +58,15 @@ Wick.Forms = (function() {
|
|
|
59
58
|
);
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
var showValidationErrors = function(form, errorMsg) {
|
|
61
|
+
var showValidationErrors = function (form, errorMsg) {
|
|
63
62
|
var $form = $(form);
|
|
64
63
|
if (!$form.hasClass(formInvalid)) {
|
|
65
64
|
$form.find('.form-row__error').remove();
|
|
66
|
-
|
|
67
|
-
return $(this).is(':visible');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
$rows.append(validationError(errorMsg)).addClass(rowValidationError);
|
|
65
|
+
$form.addClass(formInvalid).find(fieldRow).append(validationError(errorMsg)).addClass(rowValidationError);
|
|
71
66
|
}
|
|
72
67
|
|
|
73
|
-
var $firstMsg = $form.find(fieldRow).
|
|
74
|
-
|
|
75
|
-
}).first();
|
|
76
|
-
if ($firstMsg.length && !isElementInViewport($firstMsg)) {
|
|
68
|
+
var $firstMsg = $form.find(fieldRow).first();
|
|
69
|
+
if($firstMsg.length && !isElementInViewport($firstMsg)){
|
|
77
70
|
var inModal = $firstMsg.closest('.modal').length,
|
|
78
71
|
$scrollableEl = inModal ? $firstMsg.closest('.modal') : $('html, body'),
|
|
79
72
|
y = inModal ? 0 : $firstMsg.offset().top - 30;
|
|
@@ -82,26 +75,22 @@ Wick.Forms = (function() {
|
|
|
82
75
|
}
|
|
83
76
|
};
|
|
84
77
|
|
|
85
|
-
var clearValidationErrors = function(form) {
|
|
78
|
+
var clearValidationErrors = function (form) {
|
|
86
79
|
var $form = $(form);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.find(fieldError).remove();
|
|
93
|
-
|
|
94
|
-
$form.find(fieldError).remove();
|
|
80
|
+
if ($form.hasClass(formInvalid)) {
|
|
81
|
+
$form.removeClass(formInvalid)
|
|
82
|
+
.find(fieldRow).removeClass(rowValidationError)
|
|
83
|
+
.find(fieldError).remove();
|
|
84
|
+
}
|
|
95
85
|
};
|
|
96
86
|
|
|
97
|
-
|
|
98
|
-
var handleSmoothScroll = function() {
|
|
87
|
+
var handleSmoothScroll = function () {
|
|
99
88
|
$('html, body').animate({
|
|
100
|
-
scrollTop: $('.cards-store-list').offset().top - 60
|
|
89
|
+
scrollTop: $('.cards-store-list').offset().top - 60
|
|
101
90
|
}, 300);
|
|
102
91
|
};
|
|
103
92
|
|
|
104
|
-
var handleFormSubmit = function() {
|
|
93
|
+
var handleFormSubmit = function () {
|
|
105
94
|
var form = this;
|
|
106
95
|
|
|
107
96
|
if ($(form).is('#form-login') || $(form).is('#form-register')) {
|
|
@@ -115,21 +104,21 @@ Wick.Forms = (function() {
|
|
|
115
104
|
}
|
|
116
105
|
|
|
117
106
|
if ($(form).is('#form-forgotten-password')) {
|
|
118
|
-
if ($(form).find('#email').val().length)
|
|
107
|
+
if ($(form).find('#email').val().length){
|
|
119
108
|
window.location.href = './page_upd-pass.html';
|
|
120
109
|
return false;
|
|
121
110
|
}
|
|
122
111
|
}
|
|
123
112
|
|
|
124
113
|
if ($(form).is('#form-forgotten-password-popup')) {
|
|
125
|
-
if ($(form).find('#email').val().length)
|
|
114
|
+
if ($(form).find('#email').val().length){
|
|
126
115
|
window.location.href = './page_checkout_sign-in.html';
|
|
127
116
|
return false;
|
|
128
117
|
}
|
|
129
118
|
}
|
|
130
119
|
|
|
131
120
|
if ($(form).is('#checkout-form-forgotten-password-popup')) {
|
|
132
|
-
if ($(form).find('#email').val().length)
|
|
121
|
+
if ($(form).find('#email').val().length){
|
|
133
122
|
$('.modal-reset-wrap').addClass('d-block');
|
|
134
123
|
$('.request-pass').addClass('d-none');
|
|
135
124
|
$('.modal-title').text('Password Reset');
|
|
@@ -138,7 +127,7 @@ Wick.Forms = (function() {
|
|
|
138
127
|
}
|
|
139
128
|
|
|
140
129
|
if ($(form).is('.update-pass')) {
|
|
141
|
-
if ($(form).find('#new-password').val().length && $(form).find('#confirmed-password').val().length)
|
|
130
|
+
if ($(form).find('#new-password').val().length && $(form).find('#confirmed-password').val().length){
|
|
142
131
|
window.location.href = './page_login.html';
|
|
143
132
|
return false;
|
|
144
133
|
}
|
|
@@ -147,7 +136,7 @@ Wick.Forms = (function() {
|
|
|
147
136
|
if ($(form).is('.change-email')) {
|
|
148
137
|
if ($(form).find('#new-email').val().length &&
|
|
149
138
|
$(form).find('#confirm-new-email').val().length &&
|
|
150
|
-
$(form).find('#password').val().length)
|
|
139
|
+
$(form).find('#password').val().length){
|
|
151
140
|
window.location.href = './page_my-account.html';
|
|
152
141
|
return false;
|
|
153
142
|
}
|
|
@@ -156,7 +145,7 @@ Wick.Forms = (function() {
|
|
|
156
145
|
if ($(form).is('.form-change-password')) {
|
|
157
146
|
if ($(form).find('#current-password').val().length &&
|
|
158
147
|
$(form).find('#new-password').val().length &&
|
|
159
|
-
$(form).find('#confirm-password').val().length)
|
|
148
|
+
$(form).find('#confirm-password').val().length){
|
|
160
149
|
window.location.href = './page_my-account.html';
|
|
161
150
|
return false;
|
|
162
151
|
}
|
|
@@ -168,14 +157,14 @@ Wick.Forms = (function() {
|
|
|
168
157
|
$(form).find('#postcode').val().length &&
|
|
169
158
|
$(form).find('#email').val().length &&
|
|
170
159
|
$(form).find('#password').val().length &&
|
|
171
|
-
$(form).find('#confirm-password').val().length)
|
|
160
|
+
$(form).find('#confirm-password').val().length){
|
|
172
161
|
window.location.href = './page_my-account.html';
|
|
173
162
|
return false;
|
|
174
163
|
}
|
|
175
164
|
}
|
|
176
165
|
|
|
177
166
|
if ($(form).is('.form-personal-details')) {
|
|
178
|
-
if ($(form).find('#first-name').val().length && $(form).find('#surname').val().length)
|
|
167
|
+
if ($(form).find('#first-name').val().length && $(form).find('#surname').val().length){
|
|
179
168
|
window.location.href = './page_my-account.html';
|
|
180
169
|
return false;
|
|
181
170
|
}
|
|
@@ -183,26 +172,26 @@ Wick.Forms = (function() {
|
|
|
183
172
|
|
|
184
173
|
if ($(form).is('.form-address-details')) {
|
|
185
174
|
if ($(form).find('#first-name').val().length &&
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
175
|
+
$(form).find('#second-name').val().length &&
|
|
176
|
+
$(form).find('#address1').val().length &&
|
|
177
|
+
$(form).find('#town-city').val().length &&
|
|
178
|
+
$(form).find('#mobile-telephone').val().length) {
|
|
190
179
|
window.location.href = './page_my-account_address-book.html';
|
|
191
180
|
return false;
|
|
192
181
|
}
|
|
193
182
|
}
|
|
194
183
|
|
|
195
184
|
if ($(form).is('.form-locator')) {
|
|
196
|
-
if ($(form).find('#store-id').val())
|
|
185
|
+
if ($(form).find('#store-id').val()){
|
|
197
186
|
window.location.href = './page_store-locator-details.html';
|
|
198
187
|
return false;
|
|
199
188
|
}
|
|
200
189
|
}
|
|
201
190
|
|
|
202
191
|
if ($(form).is('.form-locator-list')) {
|
|
203
|
-
if ($(form).find('#postcode-town').val().length)
|
|
192
|
+
if ($(form).find('#postcode-town').val().length){
|
|
204
193
|
var actionAfterSubmit = $(form).attr('data-action');
|
|
205
|
-
if (actionAfterSubmit === 'scroll-to-list')
|
|
194
|
+
if (actionAfterSubmit === 'scroll-to-list'){
|
|
206
195
|
clearValidationErrors(this);
|
|
207
196
|
handleSmoothScroll();
|
|
208
197
|
} else {
|
|
@@ -213,7 +202,7 @@ Wick.Forms = (function() {
|
|
|
213
202
|
}
|
|
214
203
|
|
|
215
204
|
if ($(form).is('#form-mini-basket')) {
|
|
216
|
-
if (Wick.User.isLoggedIn())
|
|
205
|
+
if (Wick.User.isLoggedIn()){
|
|
217
206
|
window.location.href = './page_checkout_delivery-address.html';
|
|
218
207
|
} else {
|
|
219
208
|
window.location.href = './page_checkout_sign-in.html';
|
|
@@ -221,31 +210,13 @@ Wick.Forms = (function() {
|
|
|
221
210
|
return false;
|
|
222
211
|
}
|
|
223
212
|
|
|
224
|
-
function isNotEmpty(field)
|
|
225
|
-
|
|
226
|
-
var type = ($field.attr('type') || '').toLowerCase();
|
|
227
|
-
|
|
228
|
-
if (type === 'checkbox') {
|
|
229
|
-
return $field.is(':checked');
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (type === 'radio') {
|
|
233
|
-
var name = $field.attr('name');
|
|
234
|
-
if (!name) return false;
|
|
235
|
-
|
|
236
|
-
var $scope = $field.closest('[data-row-required]');
|
|
237
|
-
if (!$scope.length) $scope = $field.closest('form');
|
|
238
|
-
|
|
239
|
-
return $scope.find('input[type="radio"][name="' + name.replace(/"/g, '\\"') + '"]').is(':checked');
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return !!$field.val();
|
|
213
|
+
function isNotEmpty(field){
|
|
214
|
+
return !!$(field).val();
|
|
243
215
|
}
|
|
244
216
|
|
|
245
|
-
|
|
246
217
|
if ($(form).is('#form-checkout-your-details')) {
|
|
247
218
|
var requiredFields = $(form).find('[data-row-required]:visible :input');
|
|
248
|
-
if (_.every(requiredFields, isNotEmpty))
|
|
219
|
+
if (_.every(requiredFields, isNotEmpty)){
|
|
249
220
|
window.location.href = $(form).attr('data-action');
|
|
250
221
|
return false;
|
|
251
222
|
}
|
|
@@ -253,7 +224,7 @@ Wick.Forms = (function() {
|
|
|
253
224
|
|
|
254
225
|
if ($(form).is('#checkout-your-details-modal')) {
|
|
255
226
|
var requiredFields = $(form).find('[data-row-required]:visible :input');
|
|
256
|
-
if (_.every(requiredFields, isNotEmpty))
|
|
227
|
+
if (_.every(requiredFields, isNotEmpty)){
|
|
257
228
|
$('#modalDeliveryEdit').modal('hide');
|
|
258
229
|
return false;
|
|
259
230
|
}
|
|
@@ -267,15 +238,15 @@ Wick.Forms = (function() {
|
|
|
267
238
|
}
|
|
268
239
|
}
|
|
269
240
|
|
|
270
|
-
if ($(form).is('.checkout-register'))
|
|
241
|
+
if ($(form).is('.checkout-register')){
|
|
271
242
|
if ($(form).find('#password').val().length &&
|
|
272
|
-
|
|
243
|
+
$(form).find('#confirm-password').val().length) {
|
|
273
244
|
window.location.href = './page_my-account.html';
|
|
274
245
|
return false;
|
|
275
246
|
}
|
|
276
247
|
}
|
|
277
248
|
|
|
278
|
-
if ($(form).is('#form-checkout-voucher'))
|
|
249
|
+
if ($(form).is('#form-checkout-voucher')){
|
|
279
250
|
if ($(form).find('#voucher-code').val().length) {
|
|
280
251
|
return false;
|
|
281
252
|
}
|
|
@@ -287,11 +258,11 @@ Wick.Forms = (function() {
|
|
|
287
258
|
}
|
|
288
259
|
}
|
|
289
260
|
|
|
290
|
-
if ($(form).is('.header-search'))
|
|
261
|
+
if ($(form).is('.header-search')){
|
|
291
262
|
window.location.href = './page_search-results.html';
|
|
292
263
|
}
|
|
293
264
|
|
|
294
|
-
if ($(form).is('.click-and-collect__locator-form'))
|
|
265
|
+
if ($(form).is('.click-and-collect__locator-form')){
|
|
295
266
|
var $form = $(form);
|
|
296
267
|
if ($form.find('#click-and-collect-town').val().length) {
|
|
297
268
|
clearValidationErrors(this);
|
|
@@ -304,24 +275,24 @@ Wick.Forms = (function() {
|
|
|
304
275
|
return false;
|
|
305
276
|
}
|
|
306
277
|
|
|
307
|
-
if
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
278
|
+
if($(form).is('.form-track-order')) {
|
|
279
|
+
var $form = $(form);
|
|
280
|
+
|
|
281
|
+
if ($form.find('#order').val().length &&
|
|
282
|
+
$form.find('#tel').val().length &&
|
|
283
|
+
$form.find('#email').val().length &&
|
|
284
|
+
$form.find('#postcode').val().length) {
|
|
285
|
+
clearValidationErrors(this);
|
|
286
|
+
} else if (!$form.hasClass(formInvalid)) {
|
|
287
|
+
$form.addClass(formInvalid);
|
|
288
|
+
|
|
289
|
+
$(fieldRow).each(function() {
|
|
290
|
+
$(this).addClass(rowValidationError)
|
|
291
|
+
.append('<div class="form-row__error">' + $(this).data('message') + '</div>');
|
|
292
|
+
});
|
|
293
|
+
}
|
|
323
294
|
|
|
324
|
-
|
|
295
|
+
return false;
|
|
325
296
|
}
|
|
326
297
|
|
|
327
298
|
if ($(form).is('#edit-billing-address')) {
|
|
@@ -337,28 +308,28 @@ Wick.Forms = (function() {
|
|
|
337
308
|
};
|
|
338
309
|
|
|
339
310
|
var scrollLocatorListPage = function() {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
311
|
+
var isLocatorListPage = $('.cards-store-list').length;
|
|
312
|
+
var isScrollNeeded = window.location.hash === "#stores-list";
|
|
313
|
+
if (isLocatorListPage && isScrollNeeded) {
|
|
314
|
+
handleSmoothScroll();
|
|
315
|
+
}
|
|
345
316
|
};
|
|
346
317
|
|
|
347
|
-
let bindEvents = function() {
|
|
318
|
+
let bindEvents = function () {
|
|
348
319
|
let selector = excludedClassesForForm.reduce((acc, className) => {
|
|
349
320
|
return acc + ':not([class^="' + className + '"])';
|
|
350
321
|
}, 'form');
|
|
351
322
|
$(document).on('submit', selector, handleFormSubmit);
|
|
352
323
|
$forgotPassword.on('click', scenarios[2].action);
|
|
353
|
-
$('.btn-cancel').on('click', function()
|
|
324
|
+
$('.btn-cancel').on('click', function(){
|
|
354
325
|
window.location.href = './page_my-account.html';
|
|
355
326
|
});
|
|
356
|
-
$('.btn-previous').on('click', function()
|
|
327
|
+
$('.btn-previous').on('click', function(){
|
|
357
328
|
window.location.href = './page_login.html';
|
|
358
329
|
});
|
|
359
330
|
};
|
|
360
331
|
|
|
361
|
-
var init = function() {
|
|
332
|
+
var init = function () {
|
|
362
333
|
bindEvents();
|
|
363
334
|
scrollLocatorListPage();
|
|
364
335
|
};
|
|
@@ -367,6 +338,6 @@ Wick.Forms = (function() {
|
|
|
367
338
|
|
|
368
339
|
return {
|
|
369
340
|
showValidationErrors: showValidationErrors,
|
|
370
|
-
clearValidationErrors: clearValidationErrors
|
|
371
|
-
}
|
|
341
|
+
clearValidationErrors: clearValidationErrors
|
|
342
|
+
}
|
|
372
343
|
})();
|