wickes-css2 2.98.0-develop.2 → 2.98.0-develop.3
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/build/css/category-main.css +1 -1
- package/build/css/emulation.css +1 -1
- package/build/css/homepage-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/checkout-new.css +1 -1
- package/build/css/pages/my-account-v2.css +1 -1
- package/build/css/pages/page_address-book.css +1 -1
- package/build/css/pages/page_change-password.css +1 -1
- package/build/css/pages/page_default-store.css +1 -1
- package/build/css/pages/page_discount.css +1 -0
- package/build/css/pages/page_personal-details.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/pages/page_track-my-order.css +1 -1
- package/build/css/pdp-main-before-combine.css +1 -1
- package/build/css/pdp-main-critical.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/img/apps/app-lg.png +0 -0
- package/build/img/apps/app-md.png +0 -0
- package/build/js/basket.min.js +2 -2
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/default-store.min.js +1 -1
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/my-account.min.js +1 -1
- package/build/js/page/basket-v2.js +6 -14
- package/build/js/page/components/charity.js +43 -58
- package/build/js/page/default-store.js +1 -4
- package/build/js/page/my-account.js +9 -2
- package/build/js/page/personal-details.js +22 -1
- 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 -1
- package/package.json +2 -2
- package/src/components/header-menu/logout-action.hbs +8 -0
- package/src/components/header-menu/popover-actions-mob.hbs +11 -0
- package/src/components/header-menu/popover-actions.hbs +13 -0
- package/src/components/header-menu/user-actions-mob.hbs +18 -0
- package/src/components/header-menu/user-actions.hbs +12 -0
- package/src/components/my-account/clipboard-code-card.hbs +13 -6
- package/src/components/my-account/discount.hbs +3 -1
- package/src/components/price-block-order.hbs +0 -1
- package/src/components/track-my-order-info.hbs +1 -3
- package/src/data/data_header-menu.json +153 -0
- package/src/data/data_shopping-cart-v2.json +0 -51
- package/src/data/my-account/data_discount.json +80 -0
- package/src/data/my-account/data_personal-details.json +22 -0
- package/src/img/apps/app-lg.png +0 -0
- package/src/img/apps/app-md.png +0 -0
- package/src/js/components/general/clamp-content.js +1 -0
- package/src/js/components/general/main-nav.js +5 -5
- package/src/js/page/basket-v2.js +6 -14
- package/src/js/page/components/charity.js +43 -58
- package/src/js/page/default-store.js +1 -4
- package/src/js/page/my-account.js +9 -2
- package/src/js/page/personal-details.js +22 -1
- package/src/page_my-account-installer.html +2 -1
- package/src/page_my-account-trade-pro.html +1 -0
- package/src/page_my-account.html +10 -1
- package/src/page_personal-details.html +5 -0
- package/src/page_plp_v2-vat.html +8 -2
- package/src/page_shopping-cart-charity.html +56 -0
- package/src/page_shopping-cart-v2.html +1 -1
- package/src/page_tradepro-discount-app.html +82 -0
- package/src/page_tradepro-discount.html +82 -0
- package/src/partials/header.hbs +40 -41
- package/src/partials/main-nav.hbs +51 -171
- package/src/scss/common/_rewards-counter.scss +1 -1
- package/src/scss/components/_charity-donations.scss +186 -114
- package/src/scss/components/_leave-modal.scss +6 -2
- package/src/scss/components/_price-block-critical.scss +3 -3
- package/src/scss/components/_price-block.scss +8 -3
- package/src/scss/components/my-account/_barcode.scss +58 -0
- package/src/scss/components/my-account/_clipboard-code.scss +77 -0
- package/src/scss/components/my-account/_discount.scss +51 -0
- package/src/scss/emulation.scss +1 -1
- package/src/scss/helpers/_mixins.scss +9 -0
- package/src/scss/pages/checkout-new.scss +0 -1
- package/src/scss/pages/my-account-v2.scss +38 -171
- package/src/scss/pages/page_change-password.scss +1 -1
- package/src/scss/pages/page_default-store.scss +5 -4
- package/src/scss/pages/page_discount.scss +212 -0
- package/src/scss/pages/page_personal-details.scss +1 -74
- package/src/scss/pages/page_products-list-combined.scss +13 -3
- package/src/scss/pages/page_products-list.scss +9 -1
- package/src/scss/pages/page_track-my-order.scss +21 -0
- package/src/scss/partials/_header-critical.scss +2 -5
- package/src/scss/partials/_header.scss +58 -25
- package/src/scss/partials/_main-nav.scss +43 -29
- package/src/scss/plp-main.scss +1 -0
- package/src/sitemap.html +4 -0
- package/build/img/calm-primary-logo.png +0 -0
- package/src/components/basket-charity-donations-new.hbs +0 -40
- package/src/components/donation-cart-new.hbs +0 -38
- package/src/img/calm-primary-logo.png +0 -0
- package/src/scss/components/_donation-cart-new.scss +0 -192
|
@@ -1 +1 @@
|
|
|
1
|
-
!function n(
|
|
1
|
+
!function n(i,r,c){function l(t,e){if(!r[t]){if(!i[t]){var o="function"==typeof require&&require;if(!e&&o)return o(t,!0);if(a)return a(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}o=r[t]={exports:{}},i[t][0].call(o.exports,function(e){return l(i[t][1][e]||e)},o,o.exports,n,i,r,c)}return r[t].exports}for(var a="function"==typeof require&&require,e=0;e<c.length;e++)l(c[e]);return l}({1:[function(e,t,o){"use strict";var n=e("./utils/copy-to-clipboard"),i=e("./utils/helpers"),r=window.Wick||{};r.MyAccount={el:{$clipboardCode:$(".clipboard-code"),appInfo:".app-info",hideAppInfo:"app-info--hide"},clipboardCodes:{tradeProId:{titleEl:".clipboard-code.trade-pro-id .title",subtitleEl:".clipboard-code.trade-pro-id .subtitle",btnCopy:".btn--trade-pro-id"},discountCode:{titleEl:".clipboard-code.discount-code .title",subtitleEl:".clipboard-code.discount-code .subtitle",btnCopy:".btn--discount-code"}},copyCode:function(e){var e=r.MyAccount.clipboardCodes[e],t=e.titleEl,o=e.subtitleEl,e=e.btnCopy,o=$(o).text().trim(),t=$(t).text().trim();(0,n.copyToClipboard)(o,e),r.SnackBar.show({text:"".concat(t," copied to clipboard"),type:r.SnackBar.types.SUCCESS,withCloseButton:!1,autoClose:!0,delayBeforeClose:1500})},init:function(){Object.keys(r.MyAccount.clipboardCodes).forEach(function(e){var t=r.MyAccount.clipboardCodes[e].btnCopy;$(t).on("click",function(){return r.MyAccount.copyCode(e)})}),$(r.MyAccount.el.appInfo).length&&(0,i.isApp)()&&$(r.MyAccount.el.appInfo).addClass(r.MyAccount.el.hideAppInfo)}},$(document).ready(function(){r.MyAccount.el.$clipboardCode.length&&r.MyAccount.init()})},{"./utils/copy-to-clipboard":2,"./utils/helpers":3}],2:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.copyToClipboard=function(e,t){var o=$("<textarea>").css({position:"absolute",top:0,left:0,opacity:0});$(t).parent().append(o);t=e.replace(/(^\w|\s\w)/g,function(e){return e.toUpperCase()}).split(" ").filter(function(e){return""!==e}).join(" ");o.val(t),navigator.userAgent.match(/TradeProMobile_iOS|DIYMobile_iOS/i)?function(e){var e=e.get(0),t=e.contentEditable,o=e.readOnly,n=document.createRange(),i=window.getSelection();e.contentEditable=!0,e.readOnly=!1,n.selectNodeContents(e),i.removeAllRanges(),i.addRange(n),e.setSelectionRange(0,999999),e.contentEditable=t,e.readOnly=o}(o):navigator.userAgent.match(/ipad|ipod|iphone/i)?(o.select(),o[0].setSelectionRange(0,999999)):o.select();document.execCommand("copy"),o.remove()}},{}],3:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.countLetters=function(e){e=e.match(/[a-zA-Z]/g);return e?e.length:0},o.createImageElements=function(e,t){return e.map(function(e){return $("<img>").attr("src",e).attr("alt",t)})},o.highlightCharacter=function(e,t,o){return e.includes(t)?(t=new RegExp("\\".concat(t,"+"),"g"),o='<span class="'.concat(o,'">$&</span>'),e.replace(t,o)):e},o.isApp=function(){return navigator.userAgent.match(/TradeProMobile_iOS|TradeProMobile_Android|DIYMobile_iOS|DIYMobile_Android|DIYApp_Guest_Mobile_iOS|DIYApp_Guest_Mobile_Android|AGENT_PLACEHOLDER/i)},o.isHasSymbol=function(e,t){return e.includes(t)},o.isKeyboardOpen=function(){var e=window.innerHeight,t=window.visualViewport.height;return e!==t},o.isTouchDevice=function(){return"ontouchstart"in window},o.scrollToElement=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:20,e=$(e);0<e.length&&$("html, body").animate({scrollTop:e.offset().top-t},300)},o.scrollToTop=function(e){e.scrollTop(0)},o.trimFields=function(){Wick.AddressBook.getFieldsConfigurations().forEach(function(e){var t=e.input.val().trim();e.input.val(t)})}},{}]},{},[1]);
|
|
@@ -16,8 +16,8 @@ import {checkPayPalAvailability} from './basket/paypal';
|
|
|
16
16
|
import {
|
|
17
17
|
updateCharity,
|
|
18
18
|
changeCharityPrice,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
toggleCharityElements,
|
|
20
|
+
setDefaultCharityValue
|
|
21
21
|
} from './components/charity';
|
|
22
22
|
import {callAction} from './utils/http-action';
|
|
23
23
|
import {ROUTES} from './utils/routes';
|
|
@@ -80,7 +80,7 @@ Wick.BasketPage = {
|
|
|
80
80
|
orderItemInfoOffers: 'order-item__info-offers',
|
|
81
81
|
charityInput: '#donation',
|
|
82
82
|
charityItem: '.charity-new',
|
|
83
|
-
donationCartBtn: '.donation-cart__btn
|
|
83
|
+
donationCartBtn: '.donation-cart__btn',
|
|
84
84
|
checkoutWidgetDetails: '.checkout-widget__details',
|
|
85
85
|
checkoutWidgetDetailsFlex: 'checkout-widget__details-flex',
|
|
86
86
|
subtotal: '.checkout-widget__item-bold',
|
|
@@ -311,6 +311,7 @@ Wick.BasketPage = {
|
|
|
311
311
|
} else {
|
|
312
312
|
if (charity) {
|
|
313
313
|
Wick.BasketPage.updateCart();
|
|
314
|
+
quantityToUpdate === 0 && toggleCharityElements();
|
|
314
315
|
} else {
|
|
315
316
|
if (maxValue > 1 || minValue > 1) {
|
|
316
317
|
if (quantityToUpdate > maxValue || quantityToUpdate < minValue) {
|
|
@@ -1281,16 +1282,8 @@ $(document).ready(function () {
|
|
|
1281
1282
|
$(Wick.BasketPage.el.content).on('focusout', Wick.BasketPage.el.quantityValue, Wick.BasketPage.changeOnBlur);
|
|
1282
1283
|
$(Wick.BasketPage.el.content).on('click', Wick.BasketPage.el.deliveryButtonInCC, Wick.BasketPage.changeMethodToDelivery);
|
|
1283
1284
|
$(Wick.BasketPage.el.content).on('click', Wick.BasketPage.el.updateStoreButton, Wick.BasketPage.changeMethodToCC);
|
|
1284
|
-
$(Wick.BasketPage.el.
|
|
1285
|
-
|
|
1286
|
-
const context = $(this).closest(Wick.BasketPage.el.charityItem);
|
|
1287
|
-
if (!context.hasClass('charity-added')) {
|
|
1288
|
-
updateCharity(this);
|
|
1289
|
-
context.addClass('charity-added');
|
|
1290
|
-
} else {
|
|
1291
|
-
changeCharityPrice.call(this);
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1285
|
+
$(Wick.BasketPage.el.charityInput).on('click', updateCharity);
|
|
1286
|
+
$(Wick.BasketPage.el.donationCartBtn).on('click', changeCharityPrice);
|
|
1294
1287
|
$(Wick.BasketPage.el.charityItem).on('click', Wick.BasketPage.el.removeButton, updateCharity);
|
|
1295
1288
|
$(Wick.BasketPage.el.orderSummary).on('click', Wick.BasketPage.el.voucherRemove, voucherRemove);
|
|
1296
1289
|
$(Wick.BasketPage.el.promoWrapper).on('click', Wick.BasketPage.el.promoClose, Wick.BasketPage.removePromotion);
|
|
@@ -1313,7 +1306,6 @@ $(document).ready(function () {
|
|
|
1313
1306
|
);
|
|
1314
1307
|
Wick.BasketPage.updateCart(...Array(3), true);
|
|
1315
1308
|
setDefaultCharityValue();
|
|
1316
|
-
initCharityInteractions();
|
|
1317
1309
|
if (!$(Wick.BasketPage.el.loader).length) {
|
|
1318
1310
|
appendLoader(Wick.BasketPage.loaderPayload);
|
|
1319
1311
|
}
|
|
@@ -8,47 +8,34 @@ const charityEl = {
|
|
|
8
8
|
charityInput: '#donation',
|
|
9
9
|
charityTitleWrap: '.title-wrap',
|
|
10
10
|
donationCart: '.donation-cart',
|
|
11
|
+
donationCartBtn: '.donation-cart__btn',
|
|
12
|
+
donationCartHolder: '.donation-cart__holder',
|
|
11
13
|
donationCartHide: 'donation-cart__hide',
|
|
12
|
-
|
|
13
|
-
donationCartBtnSelected: '.donation-cart-new__btn.btn-selected',
|
|
14
|
-
donationCartHolder: '.donation-cart__holder, .donation-cart-new__holder',
|
|
15
|
-
donationCartValue: '.donation-cart__value, .donation-cart-new__value',
|
|
14
|
+
donationCartValue: '.donation-cart__value',
|
|
16
15
|
charityAdded: 'charity-added',
|
|
17
|
-
donationCartCostBlock: '.donation-cart-new__cost',
|
|
18
|
-
donationCartCostBlockHide: 'donation-cart-new__cost-hide',
|
|
19
|
-
donationCartRemove: '.donation-cart-new__cost .order-item__remove',
|
|
20
16
|
}
|
|
21
17
|
|
|
22
|
-
export function updateCharity(
|
|
18
|
+
export function updateCharity() {
|
|
19
|
+
//checkbox action
|
|
23
20
|
if ($('#donation').attr('disabled') === 'disabled') {
|
|
24
|
-
$('#donation').removeAttr('disabled')
|
|
21
|
+
$('#donation').removeAttr('disabled')
|
|
25
22
|
} else {
|
|
26
23
|
$('#donation').prop('disabled', (_, value) => !value);
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
const context = getCurrentCharityItem(
|
|
26
|
+
const context = getCurrentCharityItem(this);
|
|
30
27
|
const productCode = getCurrentProductCode(context);
|
|
31
|
-
const quantity = getSelectedCharityAmount(button);
|
|
32
28
|
|
|
33
29
|
showLoader('.basket-loader');
|
|
34
30
|
|
|
35
31
|
if (context.hasClass(charityEl.charityAdded)) {
|
|
36
|
-
$(
|
|
32
|
+
$(this).removeAttr('checked');
|
|
37
33
|
} else {
|
|
38
|
-
$(
|
|
39
|
-
|
|
40
|
-
context
|
|
41
|
-
.find(charityEl.donationCartValue)
|
|
42
|
-
.text(quantity);
|
|
43
|
-
showDonationCostBlock(context);
|
|
44
|
-
charityActionForAdd(productCode, quantity);
|
|
34
|
+
$(this).attr('checked', 'checked');
|
|
35
|
+
charityActionForAdd(productCode);
|
|
45
36
|
}
|
|
46
37
|
}
|
|
47
38
|
|
|
48
|
-
function getSelectedCharityAmount(context) {
|
|
49
|
-
return $(context).data('value');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
39
|
function getCurrentCharityItem(context) {
|
|
53
40
|
return $(context).closest(charityEl.charityItem);
|
|
54
41
|
}
|
|
@@ -57,13 +44,13 @@ function getCurrentProductCode(context) {
|
|
|
57
44
|
return context.find('input[name="productCode"]').val();
|
|
58
45
|
}
|
|
59
46
|
|
|
60
|
-
export function charityActionForAdd(value
|
|
47
|
+
export function charityActionForAdd(value) {
|
|
61
48
|
if (!Wick.checkLocalEnv) {
|
|
62
49
|
const payload = {
|
|
63
50
|
url: ROUTES.CHARITY_ADD,
|
|
64
51
|
queries: {
|
|
65
52
|
productCodePost: value,
|
|
66
|
-
qty:
|
|
53
|
+
qty: getDefaultCharityAmount(),
|
|
67
54
|
},
|
|
68
55
|
type: 'POST',
|
|
69
56
|
};
|
|
@@ -74,10 +61,19 @@ export function charityActionForAdd(value, quantity) {
|
|
|
74
61
|
|
|
75
62
|
callAction(payload, executeCharityAction, productInfo);
|
|
76
63
|
} else {
|
|
64
|
+
toggleCharityElements();
|
|
77
65
|
Wick.BasketPage.updateCart(...Array(2), true);
|
|
78
66
|
}
|
|
79
67
|
}
|
|
80
68
|
|
|
69
|
+
export function toggleCharityElements() {
|
|
70
|
+
if ($(charityEl.charityItem).hasClass(charityEl.charityAdded)) {
|
|
71
|
+
$(charityEl.charityInput).prop('checked', false);
|
|
72
|
+
}
|
|
73
|
+
$(charityEl.charityItem).toggleClass(charityEl.charityAdded);
|
|
74
|
+
$(charityEl.charityItem).hasClass(charityEl.charityMultiple) && toggleMultipleCharityChoose($(charityEl.charityItem));
|
|
75
|
+
}
|
|
76
|
+
|
|
81
77
|
function executeCharityAction(response, productInfo) {
|
|
82
78
|
if (response.addedProducts && response.addedProducts[0]) {
|
|
83
79
|
productInfo.quantity = response.addedProducts[0].qty;
|
|
@@ -85,6 +81,7 @@ function executeCharityAction(response, productInfo) {
|
|
|
85
81
|
}
|
|
86
82
|
|
|
87
83
|
Wick.BasketPage.updateCart(...Array(2), true);
|
|
84
|
+
toggleCharityElements();
|
|
88
85
|
}
|
|
89
86
|
|
|
90
87
|
export function changeCharityPrice() {
|
|
@@ -98,7 +95,6 @@ export function changeCharityPrice() {
|
|
|
98
95
|
|
|
99
96
|
repaintCharityButton(this);
|
|
100
97
|
$(charityEl.donationCartValue).text(charityValue);
|
|
101
|
-
showDonationCostBlock(context);
|
|
102
98
|
charityActionForChangePrice(this);
|
|
103
99
|
}
|
|
104
100
|
|
|
@@ -123,26 +119,22 @@ function repaintCharityButton(context) {
|
|
|
123
119
|
$(context).removeClass(btnSecondary).addClass(btnSelected);
|
|
124
120
|
}
|
|
125
121
|
|
|
126
|
-
function
|
|
127
|
-
const donationButtons = $(
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
function resetCharityButton(context) {
|
|
123
|
+
const donationButtons = $(context).find(charityEl.donationCartBtn);
|
|
124
|
+
const btnSelected = 'btn-selected';
|
|
125
|
+
const btnSecondary = 'btn-secondary';
|
|
126
|
+
const defaultAmount = getDefaultCharityAmount();
|
|
130
127
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
$item.find(charityEl.donationCartValue).text(value);
|
|
138
|
-
$item.find(charityEl.donationCartCostBlock)
|
|
139
|
-
.removeClass(charityEl.donationCartCostBlockHide);
|
|
140
|
-
});
|
|
128
|
+
donationButtons.each((i, btn) => {
|
|
129
|
+
$(btn).attr('data-value') === defaultAmount
|
|
130
|
+
? $(btn).removeClass(btnSecondary).addClass(btnSelected)
|
|
131
|
+
: $(btn).removeClass(btnSelected).addClass(btnSecondary);
|
|
132
|
+
})
|
|
141
133
|
}
|
|
142
134
|
|
|
143
|
-
function
|
|
144
|
-
$
|
|
145
|
-
|
|
135
|
+
function getDefaultCharityAmount() {
|
|
136
|
+
const donationButtons = $(charityEl.charityItem).find(charityEl.donationCartBtn);
|
|
137
|
+
return donationButtons.first().attr('data-value');
|
|
146
138
|
}
|
|
147
139
|
|
|
148
140
|
function resetCharityValue() {
|
|
@@ -150,19 +142,12 @@ function resetCharityValue() {
|
|
|
150
142
|
$(charityEl.donationCartValue).text(defaultValue);
|
|
151
143
|
}
|
|
152
144
|
|
|
153
|
-
export function
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
.addClass(charityEl.donationCartCostBlockHide);
|
|
162
|
-
$item
|
|
163
|
-
.find(charityEl.donationCartBtn)
|
|
164
|
-
.removeClass('btn-selected')
|
|
165
|
-
.addClass('btn-secondary');
|
|
166
|
-
resetCharityValue();
|
|
167
|
-
});
|
|
145
|
+
export function toggleMultipleCharityChoose(context) {
|
|
146
|
+
context.find(charityEl.donationCart).toggleClass(charityEl.donationCartHide);
|
|
147
|
+
resetCharityButton(context);
|
|
148
|
+
resetCharityValue();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function setDefaultCharityValue() {
|
|
152
|
+
$(charityEl.charityItem).hasClass(charityEl.charityMultiple) && resetCharityValue();
|
|
168
153
|
}
|
|
@@ -18,7 +18,7 @@ Wick.DefaultStore = {
|
|
|
18
18
|
const dropdowns = $("#openingTimes, #specialTimes, #facilities");
|
|
19
19
|
const btn = $('[data-toggle="collapse"]');
|
|
20
20
|
|
|
21
|
-
if (
|
|
21
|
+
if (Wick.Responsive.getCurrentBreakpoint() !== 'down-sm') {
|
|
22
22
|
dropdowns.addClass("show");
|
|
23
23
|
if (btn.length) {
|
|
24
24
|
btn.attr("aria-expanded", "true");
|
|
@@ -32,9 +32,6 @@ Wick.DefaultStore = {
|
|
|
32
32
|
},
|
|
33
33
|
init () {
|
|
34
34
|
Wick.DefaultStore.updateCollapseState();
|
|
35
|
-
$(window).resize( _.debounce(function () {
|
|
36
|
-
Wick.DefaultStore.updateCollapseState();
|
|
37
|
-
}, 200));
|
|
38
35
|
Wick.DefaultStore.el.$searchInput.on('input', Wick.DefaultStore.checkVisibilityOfClearButton);
|
|
39
36
|
}
|
|
40
37
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {copyToClipboard} from "./utils/copy-to-clipboard";
|
|
2
|
+
import {isApp} from "./utils/helpers";
|
|
2
3
|
|
|
3
4
|
var Wick = window.Wick || {};
|
|
4
5
|
|
|
5
6
|
Wick.MyAccount = {
|
|
6
7
|
el: {
|
|
7
|
-
$
|
|
8
|
+
$clipboardCode: $('.clipboard-code'),
|
|
9
|
+
appInfo: '.app-info',
|
|
10
|
+
hideAppInfo: 'app-info--hide'
|
|
8
11
|
},
|
|
9
12
|
clipboardCodes: {
|
|
10
13
|
tradeProId: {
|
|
@@ -39,11 +42,15 @@ Wick.MyAccount = {
|
|
|
39
42
|
const { btnCopy } = Wick.MyAccount.clipboardCodes[codeType];
|
|
40
43
|
$(btnCopy).on('click', () => Wick.MyAccount.copyCode(codeType));
|
|
41
44
|
});
|
|
45
|
+
|
|
46
|
+
if($(Wick.MyAccount.el.appInfo).length && isApp()) {
|
|
47
|
+
$(Wick.MyAccount.el.appInfo).addClass(Wick.MyAccount.el.hideAppInfo);
|
|
48
|
+
}
|
|
42
49
|
}
|
|
43
50
|
}
|
|
44
51
|
|
|
45
52
|
$(document).ready(function () {
|
|
46
|
-
if (!Wick.MyAccount.el.$
|
|
53
|
+
if (!Wick.MyAccount.el.$clipboardCode.length) {
|
|
47
54
|
return;
|
|
48
55
|
}
|
|
49
56
|
|
|
@@ -25,7 +25,9 @@ Wick.PersonalDetails = {
|
|
|
25
25
|
notification: '.notification',
|
|
26
26
|
fieldError: '.form-row.form-row_validation-error',
|
|
27
27
|
changePasswordPopup: '#change-password-popup',
|
|
28
|
+
confirmationEmailPopup: '#confirmation-email-popup',
|
|
28
29
|
globalMessage: '.globalMessages',
|
|
30
|
+
newEmailElement: '.new-email',
|
|
29
31
|
},
|
|
30
32
|
errorMessages: {
|
|
31
33
|
errorFirstName: 'Please enter your first name',
|
|
@@ -150,10 +152,25 @@ Wick.PersonalDetails = {
|
|
|
150
152
|
});
|
|
151
153
|
}
|
|
152
154
|
},
|
|
155
|
+
showConfirmationEmailPopup(currentEmail) {
|
|
156
|
+
const $popup = $(Wick.PersonalDetails.el.confirmationEmailPopup);
|
|
157
|
+
$popup.find(Wick.PersonalDetails.el.newEmailElement).text(currentEmail);
|
|
158
|
+
$popup.modal('show');
|
|
159
|
+
|
|
160
|
+
$popup.find(Wick.PersonalDetails.el.btnContinue).off('click').on('click', function () {
|
|
161
|
+
Wick.LeaveEvent.removeLeaveEvent();
|
|
162
|
+
$popup.modal('hide');
|
|
163
|
+
Wick.PersonalDetails.requestToUpdateForm();
|
|
164
|
+
});
|
|
165
|
+
},
|
|
153
166
|
submitForm(event) {
|
|
154
167
|
event.preventDefault();
|
|
155
168
|
Wick.PersonalDetails.trimAndRewriteInputs(Wick.PersonalDetails.el.userForm);
|
|
156
169
|
|
|
170
|
+
const currentState = Wick.LeaveEvent.getState(Wick.PersonalDetails.el.userForm);
|
|
171
|
+
const initialEmail = Wick.LeaveEvent.initialFormState.find(field => field.name === 'email')?.value;
|
|
172
|
+
const currentEmail = currentState.find(field => field.name === 'email')?.value;
|
|
173
|
+
|
|
157
174
|
if (!Wick.PersonalDetails.hasUnsavedChanges()) {
|
|
158
175
|
Wick.PersonalDetails.hideForm();
|
|
159
176
|
$(Wick.PersonalDetails.el.notification).remove();
|
|
@@ -162,7 +179,11 @@ Wick.PersonalDetails = {
|
|
|
162
179
|
}
|
|
163
180
|
|
|
164
181
|
if (Wick.PersonalDetails.validateForm()) {
|
|
165
|
-
|
|
182
|
+
if (initialEmail !== currentEmail) {
|
|
183
|
+
Wick.PersonalDetails.showConfirmationEmailPopup(currentEmail);
|
|
184
|
+
} else {
|
|
185
|
+
Wick.PersonalDetails.requestToUpdateForm();
|
|
186
|
+
}
|
|
166
187
|
} else {
|
|
167
188
|
Wick.Notification.show({
|
|
168
189
|
...Wick.PersonalDetails.defaultNotificationConfig,
|