wickes-css2 2.103.0-IC-977-colors-semantic.1 → 2.103.0-IC-976-pre-commit-lint.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/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_my-orders.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_wismo-orders.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/basket.min.js +1 -1
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/emulation.min.js +54 -0
- package/build/js/kitchen/kitchen-plp.min.js +1 -1
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/page/plp-cards-v2.js +15 -6
- package/build/js/page/plp-load-more.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/package.json +7 -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/injected-content.hbs +1 -1
- package/src/data/data_search-results_v2.json +56 -141
- package/src/js/components/banner-placement-manager.js +258 -0
- package/src/js/emulation/banner-placement-manager.js +53 -0
- package/src/js/page/plp-cards-v2.js +15 -6
- package/src/js/page/plp-load-more.js +1 -1
- package/src/page_plp_v2.html +16 -6
- package/src/page_search-results.html +12 -2
- package/src/scss/components/_custom-slider.scss +6 -6
- package/src/scss/components/card-product-banner.scss +91 -3
- package/src/scss/helpers/_variables.scss +1 -3
- package/src/scss/libs/_bootstrap-extracted.scss +2 -2
- package/src/scss/libs/_cat-libs.scss +10 -10
- package/src/scss/libs/_font-awesome-icons.scss +2 -0
- package/src/scss/libs/_homepage-libs.scss +12 -12
- package/src/scss/libs/_plp-libs.scss +11 -11
- package/src/scss/libs/_skeleton.scss +2 -2
- package/src/scss/libs/_store-locator-libs.scss +1 -1
- package/src/scss/libs/flatpickr.scss +4 -4
- package/src/scss/pages/_checkout-confirmation-new.scss +2 -2
- package/src/scss/pages/page_products-list-combined.scss +11 -0
- package/src/scss/pages/page_products-list.scss +8 -0
- package/src/scss/partials/_main-nav.scss +2 -2
- package/src/js/components/product-banner.js +0 -148
- package/src/scss/helpers/_colors-semantic.scss +0 -224
|
@@ -43,7 +43,7 @@ Wick.PLPLoadMore = {
|
|
|
43
43
|
.finally(() => {
|
|
44
44
|
hideLoader(Wick.PLPLoadMore.el.loader);
|
|
45
45
|
Wick.PLPLoadMore.el.$loadMoreBtn.blur();
|
|
46
|
-
Wick.
|
|
46
|
+
Wick.BannerPlacementManager.checkProductsInColumn();
|
|
47
47
|
$(window).trigger('productBannerPositionChanged');
|
|
48
48
|
Wick.EnergyEfficiency.drawEnergyLabels();
|
|
49
49
|
Wick.PLP?.bindEvents();
|
package/src/page_plp_v2.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page" title="Products list" globalSearchV2="true" pagePlp=true}}
|
|
1
|
+
{{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page retail-media" title="Products list" globalSearchV2="true" pagePlp=true}}
|
|
2
2
|
{{#content "head" mode="append" pagePlp=true}}
|
|
3
3
|
<link type="text/css" rel="stylesheet" href="./css/components/global-search.css">
|
|
4
4
|
{{/content}}
|
|
@@ -32,13 +32,23 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<div class="products-list products-list-v2">
|
|
35
|
-
{{#each
|
|
36
|
-
|
|
35
|
+
{{#each search-result_v2.products}}
|
|
36
|
+
{{>card_product_v2}}
|
|
37
37
|
{{/each}}
|
|
38
38
|
{{#if search-result_v2.product-banner}}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
{{#each search-result_v2.product-banner}}
|
|
40
|
+
{{>card_product_banner_v2}}
|
|
41
|
+
{{/each}}
|
|
42
|
+
{{/if}}
|
|
43
|
+
{{#if search-result_v2.sponsor-banner}}
|
|
44
|
+
{{#each search-result_v2.sponsor-banner}}
|
|
45
|
+
{{>card_sponsor_banner}}
|
|
46
|
+
{{/each}}
|
|
47
|
+
{{/if}}
|
|
48
|
+
{{#if search-result_v2.sponsor-product}}
|
|
49
|
+
{{#each search-result_v2.sponsor-product}}
|
|
50
|
+
{{>card_sponsor_product}}
|
|
51
|
+
{{/each}}
|
|
42
52
|
{{/if}}
|
|
43
53
|
</div>
|
|
44
54
|
<div class="load-more-wrap">
|
|
@@ -42,9 +42,19 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<div class="products-list products-list-v2">
|
|
45
|
-
{{#each
|
|
46
|
-
{{>
|
|
45
|
+
{{#each search-result_v2.products}}
|
|
46
|
+
{{>card_product_v2}}
|
|
47
47
|
{{/each}}
|
|
48
|
+
{{#if search-result_v2.sponsor-banner}}
|
|
49
|
+
{{#each search-result_v2.sponsor-banner}}
|
|
50
|
+
{{>card_sponsor_banner}}
|
|
51
|
+
{{/each}}
|
|
52
|
+
{{/if}}
|
|
53
|
+
{{#if search-result_v2.sponsor-product}}
|
|
54
|
+
{{#each search-result_v2.sponsor-product}}
|
|
55
|
+
{{>card_sponsor_product}}
|
|
56
|
+
{{/each}}
|
|
57
|
+
{{/if}}
|
|
48
58
|
</div>
|
|
49
59
|
|
|
50
60
|
<div class="sort-products-list">
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
.messages {
|
|
106
106
|
display: flex;
|
|
107
107
|
flex-direction: column;
|
|
108
|
-
border:
|
|
108
|
+
border: 0;
|
|
109
109
|
background: none;
|
|
110
110
|
|
|
111
111
|
&__text {
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
justify-content: space-between;
|
|
139
139
|
grid-gap: 8px;
|
|
140
140
|
padding: 8px 0;
|
|
141
|
-
border:
|
|
141
|
+
border: 0;
|
|
142
142
|
|
|
143
143
|
& + .products__item {
|
|
144
144
|
border-top: 1px solid $gray-light;
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
transition: all .3s ease;
|
|
230
230
|
|
|
231
231
|
&.footer-fixed {
|
|
232
|
-
box-shadow:
|
|
232
|
+
box-shadow: 0 -4px 12px 0 rgba(0, 0, 0, .08);
|
|
233
233
|
position: fixed;
|
|
234
234
|
width: 100%;
|
|
235
235
|
left: 0;
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
.custom-slider__footer {
|
|
303
|
-
box-shadow:
|
|
303
|
+
box-shadow: 0 -4px 12px 0 rgba(0, 0, 0, .08);
|
|
304
304
|
flex-direction: column;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
font-weight: 700;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
&[aria-expanded=
|
|
333
|
+
&[aria-expanded='true'] {
|
|
334
334
|
.icon-wrap .arrow-icon {
|
|
335
335
|
transform: rotate(180deg);
|
|
336
336
|
}
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
transform: rotate(180deg);
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
&[aria-expanded=
|
|
431
|
+
&[aria-expanded='true'] {
|
|
432
432
|
.icon {
|
|
433
433
|
transform: rotate(0);
|
|
434
434
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@include make-col(4);
|
|
5
5
|
margin-bottom: 30px;
|
|
6
6
|
|
|
7
|
-
@include media-breakpoint-down(md) {
|
|
7
|
+
@include media-breakpoint-down(md) {
|
|
8
8
|
@include make-col(6);
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
padding: 0 15px;
|
|
40
40
|
|
|
41
41
|
@include media-breakpoint-down(sm) {
|
|
42
|
-
display: inline-block;
|
|
42
|
+
display: inline-block;
|
|
43
43
|
padding: 0;
|
|
44
44
|
width: 100%;
|
|
45
45
|
}
|
|
@@ -49,4 +49,92 @@
|
|
|
49
49
|
display: inline-block;
|
|
50
50
|
width: 100%;
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.products-list {
|
|
55
|
+
.card-sponsor-product,
|
|
56
|
+
.card-sponsor-banner {
|
|
57
|
+
@include make-col(4);
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.card-sponsor-banner {
|
|
62
|
+
&__link {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
padding: 0 15px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&__image {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.card-sponsor-product {
|
|
76
|
+
.product-card {
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.product-card__sponsored {
|
|
82
|
+
@include font-size(12);
|
|
83
|
+
@include line-height(16);
|
|
84
|
+
color: $squant;
|
|
85
|
+
font-weight: 400;
|
|
86
|
+
margin-top: -3px;
|
|
87
|
+
margin-bottom: 15px;
|
|
88
|
+
padding: 2px 4px;
|
|
89
|
+
|
|
90
|
+
&:not(.product-card__sponsored--empty) {
|
|
91
|
+
width: max-content;
|
|
92
|
+
background: $gray-light;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@include media-breakpoint-down(md) {
|
|
98
|
+
.products-list {
|
|
99
|
+
.card-sponsor-product,
|
|
100
|
+
.card-sponsor-banner {
|
|
101
|
+
@include make-col(6);
|
|
102
|
+
|
|
103
|
+
.card {
|
|
104
|
+
max-width: 100%;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.products-list-v2 {
|
|
110
|
+
.card-sponsor-product:nth-of-type(n+3) {
|
|
111
|
+
.card {
|
|
112
|
+
&:before {
|
|
113
|
+
content: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@include media-breakpoint-down(sm) {
|
|
121
|
+
.products-list {
|
|
122
|
+
.product-card__sponsored {
|
|
123
|
+
margin-right: auto;
|
|
124
|
+
margin-left: auto;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.card-sponsor-banner {
|
|
128
|
+
position: relative;
|
|
129
|
+
|
|
130
|
+
&::after {
|
|
131
|
+
content: '';
|
|
132
|
+
position: absolute;
|
|
133
|
+
bottom: 20px;
|
|
134
|
+
left: 5px;
|
|
135
|
+
width: calc(100% - 10px);
|
|
136
|
+
border-bottom: 1px solid $gray;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -28,7 +28,7 @@ $gray-quill: #cececd;
|
|
|
28
28
|
$gray-wait: #9d9d9c;
|
|
29
29
|
$gray-dim: #656565;
|
|
30
30
|
$gray-matt: #515151;
|
|
31
|
-
$squant: #
|
|
31
|
+
$squant: #666;
|
|
32
32
|
$error-bg: #fcf2f3; // Error notification background colour
|
|
33
33
|
$positive: #8dc63f; // Positive colour
|
|
34
34
|
$negative: #ed1c24; // Negative colour
|
|
@@ -400,5 +400,3 @@ $christine: #ec6608;
|
|
|
400
400
|
$monza: #e30613;
|
|
401
401
|
$downriver: #0c3153;
|
|
402
402
|
$rose-pink: #ff858d;
|
|
403
|
-
|
|
404
|
-
@import 'colors-semantic';
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
&::after {
|
|
32
32
|
position: absolute;
|
|
33
33
|
display: block;
|
|
34
|
-
content:
|
|
34
|
+
content: '';
|
|
35
35
|
border-color: transparent;
|
|
36
36
|
border-style: solid;
|
|
37
37
|
}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
display: block;
|
|
69
69
|
width: $popover-arrow-width;
|
|
70
70
|
margin-left: ($popover-arrow-width / -2);
|
|
71
|
-
content:
|
|
71
|
+
content: '';
|
|
72
72
|
border-bottom: $popover-border-width solid $popover-header-bg;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
5
|
-
@import
|
|
6
|
-
@import
|
|
7
|
-
@import
|
|
8
|
-
@import
|
|
9
|
-
@import
|
|
10
|
-
@import 'skeleton';
|
|
1
|
+
@import 'bootstrap/scss/functions';
|
|
2
|
+
@import 'bootstrap/scss/mixins';
|
|
3
|
+
@import 'bootstrap/scss/reboot';
|
|
4
|
+
@import 'bootstrap/scss/grid';
|
|
5
|
+
@import 'bootstrap/scss/buttons';
|
|
6
|
+
@import 'bootstrap/scss/transitions';
|
|
7
|
+
@import 'bootstrap/scss/utilities';
|
|
8
|
+
@import 'bootstrap/scss/print';
|
|
9
|
+
@import 'bootstrap-extracted';
|
|
10
|
+
@import 'skeleton';
|
|
@@ -329,6 +329,7 @@ svg:not(:root).svg-inline--fa {
|
|
|
329
329
|
-webkit-transform: rotate(0);
|
|
330
330
|
transform: rotate(0)
|
|
331
331
|
}
|
|
332
|
+
|
|
332
333
|
100% {
|
|
333
334
|
-webkit-transform: rotate(360deg);
|
|
334
335
|
transform: rotate(360deg)
|
|
@@ -340,6 +341,7 @@ svg:not(:root).svg-inline--fa {
|
|
|
340
341
|
-webkit-transform: rotate(0);
|
|
341
342
|
transform: rotate(0)
|
|
342
343
|
}
|
|
344
|
+
|
|
343
345
|
100% {
|
|
344
346
|
-webkit-transform: rotate(360deg);
|
|
345
347
|
transform: rotate(360deg)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
5
|
-
@import
|
|
6
|
-
@import
|
|
7
|
-
@import
|
|
8
|
-
@import
|
|
9
|
-
@import
|
|
10
|
-
@import
|
|
11
|
-
@import
|
|
12
|
-
@import 'skeleton';
|
|
1
|
+
@import 'bootstrap/scss/functions';
|
|
2
|
+
@import 'bootstrap/scss/mixins';
|
|
3
|
+
@import 'bootstrap/scss/reboot';
|
|
4
|
+
@import 'bootstrap/scss/grid';
|
|
5
|
+
@import 'bootstrap/scss/buttons';
|
|
6
|
+
@import 'bootstrap/scss/transitions';
|
|
7
|
+
@import 'bootstrap/scss/close';
|
|
8
|
+
@import 'bootstrap/scss/modal';
|
|
9
|
+
@import 'bootstrap/scss/utilities';
|
|
10
|
+
@import 'bootstrap/scss/print';
|
|
11
|
+
@import 'bootstrap-extracted';
|
|
12
|
+
@import 'skeleton';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
5
|
-
@import
|
|
6
|
-
@import
|
|
7
|
-
@import
|
|
8
|
-
@import
|
|
9
|
-
@import
|
|
10
|
-
@import
|
|
11
|
-
@import
|
|
1
|
+
@import 'bootstrap/scss/functions';
|
|
2
|
+
@import 'bootstrap/scss/variables';
|
|
3
|
+
@import 'bootstrap/scss/mixins';
|
|
4
|
+
@import 'bootstrap/scss/reboot';
|
|
5
|
+
@import 'bootstrap/scss/tooltip';
|
|
6
|
+
@import 'bootstrap/scss/grid';
|
|
7
|
+
@import 'bootstrap/scss/buttons';
|
|
8
|
+
@import 'bootstrap/scss/transitions';
|
|
9
|
+
@import 'bootstrap/scss/utilities';
|
|
10
|
+
@import 'bootstrap/scss/print';
|
|
11
|
+
@import 'bootstrap-extracted';
|
|
12
12
|
|
|
13
13
|
@import 'swiper';
|
|
14
14
|
@import 'simplebar';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
$skeleton-element-color: #
|
|
1
|
+
$skeleton-element-color: #eee;
|
|
2
2
|
$skeleton-animation-color: #f8f8f8;
|
|
3
3
|
$skeleton-line-border-radius: 10px;
|
|
4
4
|
|
|
5
|
-
@import
|
|
5
|
+
@import 'skeleton-screen-css/dist/index.css';
|
|
6
6
|
|
|
7
7
|
.ssc-circle,
|
|
8
8
|
.ssc-hr,
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
.flatpickr {
|
|
60
60
|
&-input {
|
|
61
61
|
padding: 0;
|
|
62
|
-
border:
|
|
62
|
+
border: 0;
|
|
63
63
|
font-size: 1rem;
|
|
64
64
|
font-weight: 400;
|
|
65
65
|
line-height: 1.5rem;
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
margin-top: 4px;
|
|
82
82
|
padding: 16px;
|
|
83
83
|
border-radius: 3px;
|
|
84
|
-
box-shadow: 0 0 15px 0 rgba(0, 0, 0, .
|
|
84
|
+
box-shadow: 0 0 15px 0 rgba(0, 0, 0, .2);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
pointer-events: none;
|
|
130
130
|
|
|
131
131
|
&:hover {
|
|
132
|
-
border:
|
|
132
|
+
border: 0;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
|
|
151
151
|
input.cur-year {
|
|
152
152
|
padding-left: 0;
|
|
153
|
-
font-size:
|
|
153
|
+
font-size: .875rem;
|
|
154
154
|
font-weight: 500;
|
|
155
155
|
line-height: 1.375rem;
|
|
156
156
|
text-align: center;
|
|
@@ -284,13 +284,13 @@
|
|
|
284
284
|
|
|
285
285
|
[data-is-logged-in='true'] {
|
|
286
286
|
body {
|
|
287
|
-
background: #
|
|
287
|
+
background: #f00 !important;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
[data-is-logged-in='false'] {
|
|
292
292
|
body {
|
|
293
|
-
background: #
|
|
293
|
+
background: #00f !important;
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
}
|
|
@@ -47,6 +47,17 @@ $color-bar-radius: 3px;
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
.sponsor-top-banner {
|
|
51
|
+
margin-bottom: 20px;
|
|
52
|
+
margin-top: 10px;
|
|
53
|
+
|
|
54
|
+
&__image {
|
|
55
|
+
display: block;
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
margin-bottom: 20px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
50
61
|
.color-pick {
|
|
51
62
|
&__wrap {
|
|
52
63
|
display: none;
|
|
@@ -593,7 +593,7 @@ body.mobile-nav-opened {
|
|
|
593
593
|
|
|
594
594
|
&__section {
|
|
595
595
|
position: relative;
|
|
596
|
-
background-color: #
|
|
596
|
+
background-color: #fff;
|
|
597
597
|
|
|
598
598
|
&:not(:first-child) {
|
|
599
599
|
display: none;
|
|
@@ -622,7 +622,7 @@ body.mobile-nav-opened {
|
|
|
622
622
|
|
|
623
623
|
&__label {
|
|
624
624
|
padding: 22px 10px;
|
|
625
|
-
|
|
625
|
+
font-weight: 700;
|
|
626
626
|
color: $blue-dark;
|
|
627
627
|
border-top: 1px solid $gray-light;
|
|
628
628
|
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
var Wick = Wick || {};
|
|
2
|
-
Wick.ProductBanner = {
|
|
3
|
-
el: {
|
|
4
|
-
banners: '.card-product-banner',
|
|
5
|
-
bannerInactiveClass: 'card-product-banner--inactive',
|
|
6
|
-
productsWrap: '.products-list-v2',
|
|
7
|
-
$products: $('.product-card'),
|
|
8
|
-
attrPositionDesktop: 'data-desktop-position',
|
|
9
|
-
attrPositionMobile: 'data-mobile-position',
|
|
10
|
-
attrRequiredAmountDesktop: 'data-required-amount-desktop',
|
|
11
|
-
attrRequiredAmountMobile: 'data-required-amount-mobile',
|
|
12
|
-
hide: 'd-none'
|
|
13
|
-
},
|
|
14
|
-
currentBreakpoint: null,
|
|
15
|
-
checkProductsInColumn() {
|
|
16
|
-
Wick.ProductBanner.addInactiveClasses();
|
|
17
|
-
Wick.ProductBanner.arrangeBannersInRightOrder();
|
|
18
|
-
$(Wick.ProductBanner.el.banners).each((index, banner) => {
|
|
19
|
-
Wick.ProductBanner.hideBannerDueLimit(banner, index);
|
|
20
|
-
Wick.ProductBanner.moveBannerToSpecifiedPosition(banner);
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
moveBannerToSpecifiedPosition(banner) {
|
|
24
|
-
const $listSlots = Wick.ProductBanner.getListSlots();
|
|
25
|
-
const bannerPosition = Wick.ProductBanner.getBannerPosition(banner) - 2;
|
|
26
|
-
const listSlotsLength = $listSlots.length;
|
|
27
|
-
|
|
28
|
-
if(Wick.ProductBanner.isBannerVisible(banner)) {
|
|
29
|
-
if (bannerPosition <= listSlotsLength) {
|
|
30
|
-
if ($listSlots[bannerPosition]) {
|
|
31
|
-
Wick.ProductBanner.showBanner(banner);
|
|
32
|
-
Wick.ProductBanner.removeInactiveClass(banner);
|
|
33
|
-
Wick.ProductBanner.moveBanner(banner, $listSlots[bannerPosition]);
|
|
34
|
-
} else {
|
|
35
|
-
Wick.ProductBanner.hideBanner(banner);
|
|
36
|
-
Wick.ProductBanner.coverEdgeCases(banner);
|
|
37
|
-
}
|
|
38
|
-
} else {
|
|
39
|
-
Wick.ProductBanner.hideBanner(banner);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
moveBanner(banner, targetElement) {
|
|
44
|
-
$(banner).remove();
|
|
45
|
-
$(targetElement).after(banner);
|
|
46
|
-
},
|
|
47
|
-
hideBanner(banner) {
|
|
48
|
-
$(banner).addClass(Wick.ProductBanner.el.hide);
|
|
49
|
-
},
|
|
50
|
-
showBanner(banner) {
|
|
51
|
-
$(banner).removeClass(Wick.ProductBanner.el.hide);
|
|
52
|
-
},
|
|
53
|
-
isBannerVisible(banner) {
|
|
54
|
-
return !$(banner).hasClass(Wick.ProductBanner.el.hide);
|
|
55
|
-
},
|
|
56
|
-
hideBannerDueLimit(banner) {
|
|
57
|
-
const bannerMinLimit = Wick.ProductBanner.getBannerLimit(banner) - 1;
|
|
58
|
-
const $listSlots = Wick.ProductBanner.getListSlots();
|
|
59
|
-
const listProductsLength = $listSlots.length;
|
|
60
|
-
Wick.ProductBanner.showBanner(banner);
|
|
61
|
-
|
|
62
|
-
if (bannerMinLimit > listProductsLength) {
|
|
63
|
-
Wick.ProductBanner.hideBanner(banner);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
getBannerPosition(banner) {
|
|
67
|
-
const isMobile = Wick.ProductBanner.isMobileResolution();
|
|
68
|
-
const positionAttribute = isMobile
|
|
69
|
-
? Wick.ProductBanner.el.attrPositionMobile
|
|
70
|
-
: Wick.ProductBanner.el.attrPositionDesktop
|
|
71
|
-
|
|
72
|
-
return banner.hasAttribute(positionAttribute)
|
|
73
|
-
? Number(banner.getAttribute(positionAttribute))
|
|
74
|
-
: Number(Wick.ProductBanner.getListLength() + Wick.ProductBanner.getBannersAmount());
|
|
75
|
-
},
|
|
76
|
-
getBannerLimit(banner) {
|
|
77
|
-
const isMobile = Wick.ProductBanner.isMobileResolution();
|
|
78
|
-
|
|
79
|
-
const limitAttribute = isMobile
|
|
80
|
-
? Wick.ProductBanner.el.attrRequiredAmountMobile
|
|
81
|
-
: Wick.ProductBanner.el.attrRequiredAmountDesktop;
|
|
82
|
-
|
|
83
|
-
return banner.hasAttribute(limitAttribute)
|
|
84
|
-
? Number(banner.getAttribute(limitAttribute))
|
|
85
|
-
: 0;
|
|
86
|
-
},
|
|
87
|
-
isMobileResolution() {
|
|
88
|
-
return Wick.Responsive.getCurrentBreakpoint() !== 'up-lg';
|
|
89
|
-
},
|
|
90
|
-
getListLength() {
|
|
91
|
-
const $listItems = $(Wick.ProductBanner.el.productsWrap).find('.product-card');
|
|
92
|
-
return $listItems.length;
|
|
93
|
-
},
|
|
94
|
-
getBannersAmount() {
|
|
95
|
-
return $(Wick.ProductBanner.el.banners).length;
|
|
96
|
-
},
|
|
97
|
-
getProductsAmount() {
|
|
98
|
-
return Wick.ProductBanner.el.$products.length;
|
|
99
|
-
},
|
|
100
|
-
arrangeBannersInRightOrder() {
|
|
101
|
-
$(Wick.ProductBanner.el.banners).sort((a, b) => {
|
|
102
|
-
let bannerPositionA = Wick.ProductBanner.getBannerPosition(a);
|
|
103
|
-
let bannerPositionB = Wick.ProductBanner.getBannerPosition(b);
|
|
104
|
-
|
|
105
|
-
return bannerPositionA - bannerPositionB
|
|
106
|
-
}).appendTo(Wick.ProductBanner.el.productsWrap);
|
|
107
|
-
},
|
|
108
|
-
addInactiveClasses() {
|
|
109
|
-
$(Wick.ProductBanner.el.banners).addClass(Wick.ProductBanner.el.bannerInactiveClass);
|
|
110
|
-
},
|
|
111
|
-
removeInactiveClass(banner) {
|
|
112
|
-
$(banner).removeClass(Wick.ProductBanner.el.bannerInactiveClass)
|
|
113
|
-
},
|
|
114
|
-
insertFirstBanner(banner) {
|
|
115
|
-
const bannerPosition = Wick.ProductBanner.getBannerPosition(banner);
|
|
116
|
-
|
|
117
|
-
if (bannerPosition === 1) {
|
|
118
|
-
Wick.ProductBanner.showBanner(banner);
|
|
119
|
-
Wick.ProductBanner.removeInactiveClass(banner);
|
|
120
|
-
$(banner).remove();
|
|
121
|
-
$(Wick.ProductBanner.el.productsWrap).prepend(banner);
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
coverEdgeCases(banner) {
|
|
125
|
-
Wick.ProductBanner.insertFirstBanner(banner);
|
|
126
|
-
},
|
|
127
|
-
getListSlots() {
|
|
128
|
-
return $(Wick.ProductBanner.el.productsWrap)
|
|
129
|
-
.find('.product-card, .card-product-banner:not(.card-product-banner--inactive)');
|
|
130
|
-
},
|
|
131
|
-
init() {
|
|
132
|
-
Wick.Responsive.onResize(function () {
|
|
133
|
-
if(Wick.ProductBanner.currentBreakpoint !== Wick.Responsive.getCurrentBreakpoint()) {
|
|
134
|
-
Wick.ProductBanner.currentBreakpoint = Wick.Responsive.getCurrentBreakpoint()
|
|
135
|
-
Wick.ProductBanner.checkProductsInColumn();
|
|
136
|
-
$(window).trigger('productBannerPositionChanged');
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
$(document).ready(function () {
|
|
143
|
-
if (!Wick.ProductBanner.getBannersAmount() || !Wick.ProductBanner.getProductsAmount()) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
Wick.ProductBanner.init();
|
|
148
|
-
})
|