wickes-css2 2.98.0-develop.1 → 2.98.0-develop.11
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 +3 -3
- package/build/css/category-main.css +1 -1
- package/build/css/components/checkout-payment-details-v2.css +1 -1
- package/build/css/components/global-search.css +1 -1
- package/build/css/components/loader.css +1 -1
- package/build/css/components/price-block-v2-critical.css +1 -1
- package/build/css/components/price-block-v2.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/checkout.css +1 -1
- package/build/css/pages/my-account-v2.css +1 -1
- package/build/css/pages/page_home.css +1 -1
- package/build/css/pages/page_my-order.css +1 -1
- package/build/css/pages/page_my-orders.css +1 -1
- package/build/css/pages/page_wismo-details.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/billie-logo.svg +4 -0
- package/build/img/billie-modal.svg +4 -0
- package/build/img/billie-pdp.svg +11 -0
- package/build/img/billie-spinner.svg +5 -0
- package/build/img/billie.svg +4 -0
- package/build/img/calm-primary-logo.png +0 -0
- package/build/img/payment/checkout/billie.svg +4 -0
- package/build/img/payment/footer/billie.svg +4 -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/emulation.min.js +23 -33
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/page/basket-v2.js +16 -7
- package/build/js/page/billie-business-type.js +34 -0
- package/build/js/page/checkout-payment-details.js +8 -0
- package/build/js/page/components/charity.js +58 -43
- package/build/js/page/components/modal-observer.js +51 -0
- package/build/js/page/smart-banner.js +4 -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/build/js/smart-banner.min.js +1 -1
- package/package.json +1 -9
- package/src/components/address-billie.hbs +42 -0
- package/src/components/address-postcode-look-up.hbs +2 -2
- package/src/components/basket-charity-donations-new.hbs +40 -0
- package/src/components/billie-modal.hbs +41 -0
- package/src/components/billie-online-messaging.hbs +14 -0
- package/src/components/checkout-edit-billing-address.hbs +20 -6
- package/src/components/checkout-payment-details-v2.hbs +94 -55
- package/src/components/checkout-payment-info-block.hbs +49 -0
- package/src/components/checkout-payment-option.hbs +40 -0
- package/src/components/checkout_payment-new.hbs +10 -1
- package/src/components/donation-cart-new.hbs +38 -0
- package/src/components/modal.hbs +4 -1
- package/src/components/my-account/active-orders/list-orders.hbs +1 -1
- package/src/components/my-account/active-orders/order.hbs +2 -0
- package/src/components/my-account/active-orders/payment-status.hbs +17 -0
- package/src/components/my-account/payment-status.hbs +19 -0
- package/src/components/my-account/saving-totaliser.hbs +52 -0
- package/src/components/order-summary.hbs +3 -0
- package/src/components/payment-loader.hbs +59 -21
- package/src/components/payments-checkout-v2.hbs +12 -6
- package/src/components/payments-checkout.hbs +6 -0
- package/src/components/payments.hbs +10 -4
- package/src/components/price-block-v2.hbs +13 -8
- package/src/components/smart-banner.hbs +1 -1
- package/src/components/wismo-payment.hbs +16 -0
- package/src/data/data_shopping-cart-v2.json +51 -0
- package/src/data/data_wismo.json +53 -0
- package/src/data/my-account/data_my-account.json +57 -0
- package/src/elements/radiobutton.hbs +7 -0
- package/src/img/billie-logo.svg +4 -0
- package/src/img/billie-modal.svg +4 -0
- package/src/img/billie-pdp.svg +11 -0
- package/src/img/billie-spinner.svg +5 -0
- package/src/img/billie.svg +4 -0
- package/src/img/calm-primary-logo.png +0 -0
- package/src/img/payment/checkout/billie.svg +4 -0
- package/src/img/payment/footer/billie.svg +4 -0
- package/src/js/components/general/main-nav.js +6 -282
- package/src/js/components/general/notification.js +1 -1
- package/src/js/emulation/paymentLoader.js +22 -11
- package/src/js/page/basket-v2.js +16 -7
- package/src/js/page/billie-business-type.js +34 -0
- package/src/js/page/checkout-payment-details.js +8 -0
- package/src/js/page/components/charity.js +58 -43
- package/src/js/page/components/modal-observer.js +51 -0
- package/src/js/page/smart-banner.js +4 -1
- package/src/layouts/base.hbs +0 -3
- package/src/layouts/bicester-kitchen.hbs +0 -3
- package/src/layouts/my-account.hbs +0 -3
- package/src/page_basket-billie.html +54 -0
- package/src/page_checkout_confirmation-billie.html +339 -0
- package/src/page_checkout_delivery-address-customer-journey.html +2 -2
- package/src/page_my-account-trade-pro-components.html +27 -0
- package/src/page_my-account-trade-pro.html +7 -0
- package/src/page_my-account.html +1 -0
- package/src/page_my-order.html +1 -1
- package/src/page_payment-details-with-billie.html +67 -0
- package/src/page_product-details-billie.html +87 -0
- package/src/page_shopping-cart-v2.html +4 -3
- package/src/page_wismo-details.html +2 -2
- package/src/partials/head.hbs +1 -5
- package/src/partials/main-nav.hbs +0 -1
- package/src/scss/common/_app.scss +0 -1
- package/src/scss/common/_elements.scss +4 -0
- package/src/scss/components/_billie-modal.scss +181 -0
- package/src/scss/components/_billie-online-messaging.scss +46 -0
- package/src/scss/components/_charity-donations.scss +114 -186
- package/src/scss/components/_donation-cart-new.scss +192 -0
- package/src/scss/components/_payments-checkout.scss +2 -1
- package/src/scss/components/_payments-v2.scss +8 -0
- package/src/scss/components/_smart-banner.scss +4 -2
- package/src/scss/components/_tooltip.scss +19 -0
- package/src/scss/components/checkout-payment-details-v2.scss +237 -0
- package/src/scss/components/loader.scss +8 -0
- package/src/scss/components/my-account/_active-orders.scss +2 -0
- package/src/scss/components/my-account/_payment-status.scss +84 -0
- package/src/scss/components/my-account/_saving-totaliser.scss +175 -0
- package/src/scss/components/price-block-v2-critical.scss +4 -0
- package/src/scss/components/price-block-v2.scss +4 -0
- package/src/scss/globals/_global-components.scss +0 -1
- package/src/scss/main.scss +0 -1
- package/src/scss/pages/_checkout-confirmation-new.scss +10 -3
- package/src/scss/pages/checkout-new.scss +3 -0
- package/src/scss/pages/my-account-v2.scss +3 -0
- package/src/scss/pages/page_wismo-details.scss +1 -0
- package/src/scss/partials/_main-nav.scss +0 -31
- package/src/scss/pdp-main-critical.scss +1 -1
- package/src/scss/pdp-main.scss +2 -0
- package/src/sitemap.html +24 -19
- package/src/components/google-banner.hbs +0 -29
- package/src/js/emulation/main-nav-local.js +0 -21
- package/src/page_app_google_banner.html +0 -176
- package/src/page_my-account_tradePro-with-google-banner.html +0 -147
- package/src/page_old-navigation.html +0 -10
- package/src/page_product-details_google-banner.html +0 -124
- package/src/page_shopping-cart-charity.html +0 -56
- package/src/scss/components/_google_banner-critical.scss +0 -66
- package/src/scss/components/_google_banner.scss +0 -80
|
@@ -16,8 +16,8 @@ import {checkPayPalAvailability} from './basket/paypal';
|
|
|
16
16
|
import {
|
|
17
17
|
updateCharity,
|
|
18
18
|
changeCharityPrice,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
setDefaultCharityValue,
|
|
20
|
+
initCharityInteractions,
|
|
21
21
|
} from './components/charity';
|
|
22
22
|
import {callAction} from './utils/http-action';
|
|
23
23
|
import {ROUTES} from './utils/routes';
|
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
} from './basket/session-sync'
|
|
30
30
|
import {displayEnergyEfficiency} from "./basket/display-energy-efficiency";
|
|
31
31
|
import {appendLoader, hideLoader, showLoader} from "./utils/loader";
|
|
32
|
-
import {addClassToSummaryAside} from "./basket/summary-mobile";
|
|
33
32
|
import { initStickyObserver } from './components/sticky-order-observer';
|
|
33
|
+
import {addClassToSummaryAside} from "./basket/summary-mobile";
|
|
34
34
|
|
|
35
35
|
var Wick = window.Wick || {};
|
|
36
36
|
Wick.BasketPage = {
|
|
@@ -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, .donation-cart-new__btn',
|
|
84
84
|
checkoutWidgetDetails: '.checkout-widget__details',
|
|
85
85
|
checkoutWidgetDetailsFlex: 'checkout-widget__details-flex',
|
|
86
86
|
subtotal: '.checkout-widget__item-bold',
|
|
@@ -311,7 +311,6 @@ Wick.BasketPage = {
|
|
|
311
311
|
} else {
|
|
312
312
|
if (charity) {
|
|
313
313
|
Wick.BasketPage.updateCart();
|
|
314
|
-
quantityToUpdate === 0 && toggleCharityElements();
|
|
315
314
|
} else {
|
|
316
315
|
if (maxValue > 1 || minValue > 1) {
|
|
317
316
|
if (quantityToUpdate > maxValue || quantityToUpdate < minValue) {
|
|
@@ -1282,8 +1281,16 @@ $(document).ready(function () {
|
|
|
1282
1281
|
$(Wick.BasketPage.el.content).on('focusout', Wick.BasketPage.el.quantityValue, Wick.BasketPage.changeOnBlur);
|
|
1283
1282
|
$(Wick.BasketPage.el.content).on('click', Wick.BasketPage.el.deliveryButtonInCC, Wick.BasketPage.changeMethodToDelivery);
|
|
1284
1283
|
$(Wick.BasketPage.el.content).on('click', Wick.BasketPage.el.updateStoreButton, Wick.BasketPage.changeMethodToCC);
|
|
1285
|
-
$(Wick.BasketPage.el.
|
|
1286
|
-
|
|
1284
|
+
$(Wick.BasketPage.el.donationCartBtn).on('click', function(e) {
|
|
1285
|
+
e.preventDefault();
|
|
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
|
+
});
|
|
1287
1294
|
$(Wick.BasketPage.el.charityItem).on('click', Wick.BasketPage.el.removeButton, updateCharity);
|
|
1288
1295
|
$(Wick.BasketPage.el.orderSummary).on('click', Wick.BasketPage.el.voucherRemove, voucherRemove);
|
|
1289
1296
|
$(Wick.BasketPage.el.promoWrapper).on('click', Wick.BasketPage.el.promoClose, Wick.BasketPage.removePromotion);
|
|
@@ -1305,7 +1312,9 @@ $(document).ready(function () {
|
|
|
1305
1312
|
'.summary__aside.collapse.show'
|
|
1306
1313
|
);
|
|
1307
1314
|
Wick.BasketPage.updateCart(...Array(3), true);
|
|
1315
|
+
|
|
1308
1316
|
setDefaultCharityValue();
|
|
1317
|
+
initCharityInteractions();
|
|
1309
1318
|
if (!$(Wick.BasketPage.el.loader).length) {
|
|
1310
1319
|
appendLoader(Wick.BasketPage.loaderPayload);
|
|
1311
1320
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var Wick = window.Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.BusinessType = {
|
|
4
|
+
el: {
|
|
5
|
+
radios: 'input[name="businessType"]',
|
|
6
|
+
panels: '.radio-expanded-content'
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
refreshPanels() {
|
|
10
|
+
const $radios = $(this.el.radios);
|
|
11
|
+
const $panels = $(this.el.panels);
|
|
12
|
+
const selectedValue = $radios.filter(':checked').val();
|
|
13
|
+
|
|
14
|
+
$panels.hide();
|
|
15
|
+
$(`#${selectedValue}-fields`).show();
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
bindEvents() {
|
|
19
|
+
$(this.el.radios).on('change', this.refreshPanels.bind(this));
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
init() {
|
|
23
|
+
if (!$(this.el.radios).length) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
this.refreshPanels();
|
|
28
|
+
this.bindEvents();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
$(document).ready(function () {
|
|
33
|
+
Wick.BusinessType.init();
|
|
34
|
+
});
|
|
@@ -62,6 +62,14 @@ Wick.CheckoutPaymentDetails = (function() {
|
|
|
62
62
|
case 'klarna':
|
|
63
63
|
hideBillingAddres();
|
|
64
64
|
break;
|
|
65
|
+
case 'billie':
|
|
66
|
+
detailsLabel = {
|
|
67
|
+
...detailsLabel,
|
|
68
|
+
labelText: 'Name on Billie account',
|
|
69
|
+
buttonText: 'Pay with Billie'
|
|
70
|
+
}
|
|
71
|
+
changeLabelText(detailsLabel);
|
|
72
|
+
break;
|
|
65
73
|
case 'clearpay':
|
|
66
74
|
detailsLabel = {
|
|
67
75
|
...detailsLabel,
|
|
@@ -8,34 +8,47 @@ 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',
|
|
13
11
|
donationCartHide: 'donation-cart__hide',
|
|
14
|
-
|
|
12
|
+
donationCartBtn: '.donation-cart__btn, .donation-cart-new__btn',
|
|
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',
|
|
15
16
|
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',
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
export function updateCharity() {
|
|
19
|
-
//checkbox action
|
|
22
|
+
export function updateCharity(button) {
|
|
20
23
|
if ($('#donation').attr('disabled') === 'disabled') {
|
|
21
|
-
$('#donation').removeAttr('disabled')
|
|
24
|
+
$('#donation').removeAttr('disabled');
|
|
22
25
|
} else {
|
|
23
26
|
$('#donation').prop('disabled', (_, value) => !value);
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
const context = getCurrentCharityItem(
|
|
29
|
+
const context = getCurrentCharityItem(button);
|
|
27
30
|
const productCode = getCurrentProductCode(context);
|
|
31
|
+
const quantity = getSelectedCharityAmount(button);
|
|
28
32
|
|
|
29
33
|
showLoader('.basket-loader');
|
|
30
34
|
|
|
31
35
|
if (context.hasClass(charityEl.charityAdded)) {
|
|
32
|
-
$(
|
|
36
|
+
$(button).removeAttr('checked');
|
|
33
37
|
} else {
|
|
34
|
-
$(
|
|
35
|
-
|
|
38
|
+
$(button).attr('checked', 'checked');
|
|
39
|
+
repaintCharityButton(button);
|
|
40
|
+
context
|
|
41
|
+
.find(charityEl.donationCartValue)
|
|
42
|
+
.text(quantity);
|
|
43
|
+
showDonationCostBlock(context);
|
|
44
|
+
charityActionForAdd(productCode, quantity);
|
|
36
45
|
}
|
|
37
46
|
}
|
|
38
47
|
|
|
48
|
+
function getSelectedCharityAmount(context) {
|
|
49
|
+
return $(context).data('value');
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
function getCurrentCharityItem(context) {
|
|
40
53
|
return $(context).closest(charityEl.charityItem);
|
|
41
54
|
}
|
|
@@ -44,13 +57,13 @@ function getCurrentProductCode(context) {
|
|
|
44
57
|
return context.find('input[name="productCode"]').val();
|
|
45
58
|
}
|
|
46
59
|
|
|
47
|
-
export function charityActionForAdd(value) {
|
|
60
|
+
export function charityActionForAdd(value, quantity) {
|
|
48
61
|
if (!Wick.checkLocalEnv) {
|
|
49
62
|
const payload = {
|
|
50
63
|
url: ROUTES.CHARITY_ADD,
|
|
51
64
|
queries: {
|
|
52
65
|
productCodePost: value,
|
|
53
|
-
qty:
|
|
66
|
+
qty: quantity,
|
|
54
67
|
},
|
|
55
68
|
type: 'POST',
|
|
56
69
|
};
|
|
@@ -61,19 +74,10 @@ export function charityActionForAdd(value) {
|
|
|
61
74
|
|
|
62
75
|
callAction(payload, executeCharityAction, productInfo);
|
|
63
76
|
} else {
|
|
64
|
-
toggleCharityElements();
|
|
65
77
|
Wick.BasketPage.updateCart(...Array(2), true);
|
|
66
78
|
}
|
|
67
79
|
}
|
|
68
80
|
|
|
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
|
-
|
|
77
81
|
function executeCharityAction(response, productInfo) {
|
|
78
82
|
if (response.addedProducts && response.addedProducts[0]) {
|
|
79
83
|
productInfo.quantity = response.addedProducts[0].qty;
|
|
@@ -81,7 +85,6 @@ function executeCharityAction(response, productInfo) {
|
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
Wick.BasketPage.updateCart(...Array(2), true);
|
|
84
|
-
toggleCharityElements();
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
export function changeCharityPrice() {
|
|
@@ -95,6 +98,7 @@ export function changeCharityPrice() {
|
|
|
95
98
|
|
|
96
99
|
repaintCharityButton(this);
|
|
97
100
|
$(charityEl.donationCartValue).text(charityValue);
|
|
101
|
+
showDonationCostBlock(context);
|
|
98
102
|
charityActionForChangePrice(this);
|
|
99
103
|
}
|
|
100
104
|
|
|
@@ -119,35 +123,46 @@ function repaintCharityButton(context) {
|
|
|
119
123
|
$(context).removeClass(btnSecondary).addClass(btnSelected);
|
|
120
124
|
}
|
|
121
125
|
|
|
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();
|
|
127
|
-
|
|
128
|
-
donationButtons.each((i, btn) => {
|
|
129
|
-
$(btn).attr('data-value') === defaultAmount
|
|
130
|
-
? $(btn).removeClass(btnSecondary).addClass(btnSelected)
|
|
131
|
-
: $(btn).removeClass(btnSelected).addClass(btnSecondary);
|
|
132
|
-
})
|
|
133
|
-
}
|
|
134
|
-
|
|
135
126
|
function getDefaultCharityAmount() {
|
|
136
127
|
const donationButtons = $(charityEl.charityItem).find(charityEl.donationCartBtn);
|
|
137
128
|
return donationButtons.first().attr('data-value');
|
|
138
129
|
}
|
|
139
130
|
|
|
131
|
+
export function setDefaultCharityValue() {
|
|
132
|
+
$(charityEl.donationCartBtnSelected).each(function() {
|
|
133
|
+
const $btn = $(this);
|
|
134
|
+
const $item = $btn.closest(charityEl.charityItem);
|
|
135
|
+
const value = $btn.data('value');
|
|
136
|
+
|
|
137
|
+
$item.find(charityEl.donationCartValue).text(value);
|
|
138
|
+
$item.find(charityEl.donationCartCostBlock)
|
|
139
|
+
.removeClass(charityEl.donationCartCostBlockHide);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function showDonationCostBlock($charity) {
|
|
144
|
+
$charity.find(charityEl.donationCartCostBlock)
|
|
145
|
+
.removeClass(charityEl.donationCartCostBlockHide);
|
|
146
|
+
}
|
|
147
|
+
|
|
140
148
|
function resetCharityValue() {
|
|
141
149
|
const defaultValue = getDefaultCharityAmount();
|
|
142
150
|
$(charityEl.donationCartValue).text(defaultValue);
|
|
143
151
|
}
|
|
144
152
|
|
|
145
|
-
export function
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
export function initCharityInteractions() {
|
|
154
|
+
$(document).on('click', charityEl.donationCartRemove, function(e) {
|
|
155
|
+
e.preventDefault();
|
|
156
|
+
|
|
157
|
+
const $item = $(this).closest(charityEl.charityItem);
|
|
158
|
+
$item.removeClass(charityEl.charityAdded);
|
|
159
|
+
$item
|
|
160
|
+
.find(charityEl.donationCartCostBlock)
|
|
161
|
+
.addClass(charityEl.donationCartCostBlockHide);
|
|
162
|
+
$item
|
|
163
|
+
.find(charityEl.donationCartBtn)
|
|
164
|
+
.removeClass('btn-selected')
|
|
165
|
+
.addClass('btn-secondary');
|
|
166
|
+
resetCharityValue();
|
|
167
|
+
});
|
|
153
168
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.ModalObserver = (function () {
|
|
4
|
+
const modal = $('.modal-scroll-observer');
|
|
5
|
+
modalContent = modal.find('.modal-content'),
|
|
6
|
+
modalBody = modal.find('.modal-body');
|
|
7
|
+
|
|
8
|
+
$(document).ready(function () {
|
|
9
|
+
if (!modal.length) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function updateScrollFades() {
|
|
14
|
+
const tolerance = 5;
|
|
15
|
+
const scrollTop = modalBody.scrollTop();
|
|
16
|
+
const scrollHeight = modalBody.prop('scrollHeight');
|
|
17
|
+
const visibleHeight = modalBody.outerHeight();
|
|
18
|
+
|
|
19
|
+
const isAtTop = scrollTop <= tolerance;
|
|
20
|
+
const isAtBottom = scrollTop + visibleHeight >= scrollHeight - tolerance;
|
|
21
|
+
|
|
22
|
+
let state;
|
|
23
|
+
|
|
24
|
+
if (isAtTop && isAtBottom) {
|
|
25
|
+
state = 'full';
|
|
26
|
+
} else if (isAtTop) {
|
|
27
|
+
state = 'top';
|
|
28
|
+
} else if (isAtBottom) {
|
|
29
|
+
state = 'bottom';
|
|
30
|
+
} else {
|
|
31
|
+
state = 'middle';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
modalContent.attr('data-scroll-state', state);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
modalBody.on('scroll', updateScrollFades);
|
|
38
|
+
|
|
39
|
+
modal.on('shown.bs.modal', function() {
|
|
40
|
+
updateScrollFades();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
$(window).on('resize', function() {
|
|
44
|
+
if (modal.is(':visible')) {
|
|
45
|
+
updateScrollFades();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
})();
|
|
@@ -21,10 +21,13 @@ Wick.SmartBanner = {
|
|
|
21
21
|
$(Wick.SmartBanner.CLOSE_BUTTON_SELECTOR).on('click', Wick.SmartBanner.closeBanner);
|
|
22
22
|
$(Wick.SmartBanner.OPEN_BUTTON_SELECTOR).on('click', Wick.SmartBanner.handleOpenClick);
|
|
23
23
|
$(Wick.SmartBanner.INSTALL_BUTTON_SELECTOR).on('click', Wick.SmartBanner.handleInstallClick);
|
|
24
|
+
if ('scrollRestoration' in history) {
|
|
25
|
+
history.scrollRestoration = 'manual';
|
|
26
|
+
}
|
|
24
27
|
},
|
|
25
28
|
|
|
26
29
|
hideBanner: function () {
|
|
27
|
-
$(Wick.SmartBanner.BANNER_SELECTOR).
|
|
30
|
+
$(Wick.SmartBanner.BANNER_SELECTOR).addClass('hide');
|
|
28
31
|
},
|
|
29
32
|
|
|
30
33
|
closeBanner: function (e) {
|