@total_onion/onion-library 2.0.83 → 2.0.85
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/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.scss +0 -133
- package/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.vue +8 -137
- package/components/component-block-padding-v3/block-padding-v3.twig +12 -32
- package/components/component-block-padding-v3/group_689f66f3e26df.json +15 -369
- package/components/component-block-settings-v3/group_689f649af2ac4.json +182 -52
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@use '../fields-core-mixins-v3/core-mixins-v3';
|
|
2
2
|
@use '../fields-core-functions-v3/core-functions-v3';
|
|
3
3
|
@use '../../breakpoints';
|
|
4
|
-
// @use 'Assets/scss/modules/library-modules/core-gradient-designer/core-gradient-designer';
|
|
5
4
|
@use '../component-grid-layout-element-v3/grid-layout-element-v3';
|
|
6
5
|
@use '../component-element-positioning-v3/element-positioning-v3';
|
|
7
6
|
|
|
@@ -546,100 +545,6 @@
|
|
|
546
545
|
);
|
|
547
546
|
}
|
|
548
547
|
}
|
|
549
|
-
&__market-toggle {
|
|
550
|
-
background: var(--black);
|
|
551
|
-
align-items: center;
|
|
552
|
-
display: inline-flex;
|
|
553
|
-
gap: core-functions-v3.fluidSize(10, 'static');
|
|
554
|
-
padding: core-functions-v3.fluidSize(15, 'static')
|
|
555
|
-
core-functions-v3.fluidSize(10, 'static');
|
|
556
|
-
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
557
|
-
padding: core-functions-v3.fluidSize(15, 'static');
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
&__switch {
|
|
561
|
-
align-items: center;
|
|
562
|
-
display: inline-flex;
|
|
563
|
-
gap: core-functions-v3.fluidSize(10, 'static');
|
|
564
|
-
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
565
|
-
gap: core-functions-v3.fluidSize(20, 'static');
|
|
566
|
-
}
|
|
567
|
-
margin: auto;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
&__switch-toggle {
|
|
571
|
-
display: inline-block;
|
|
572
|
-
position: relative;
|
|
573
|
-
height: core-functions-v3.fluidSize(26, 'static');
|
|
574
|
-
width: core-functions-v3.fluidSize(50, 'static');
|
|
575
|
-
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
576
|
-
height: core-functions-v3.fluidSize(34, 'static');
|
|
577
|
-
width: core-functions-v3.fluidSize(68, 'static');
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
input {
|
|
581
|
-
opacity: 0;
|
|
582
|
-
width: 0;
|
|
583
|
-
height: 0;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
.switch-slider {
|
|
587
|
-
background-color: var(--palette-default-1);
|
|
588
|
-
border-radius: core-functions-v3.fluidSize(34, 'static');
|
|
589
|
-
bottom: 0;
|
|
590
|
-
cursor: pointer;
|
|
591
|
-
height: core-functions-v3.fluidSize(26, 'static');
|
|
592
|
-
left: 0;
|
|
593
|
-
top: 0;
|
|
594
|
-
position: absolute;
|
|
595
|
-
right: 0;
|
|
596
|
-
transition: 0.4s;
|
|
597
|
-
width: core-functions-v3.fluidSize(50, 'static');
|
|
598
|
-
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
599
|
-
height: core-functions-v3.fluidSize(34, 'static');
|
|
600
|
-
width: core-functions-v3.fluidSize(68, 'static');
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
&::before {
|
|
604
|
-
background-color: var(--black);
|
|
605
|
-
border-radius: 50%;
|
|
606
|
-
bottom: core-functions-v3.fluidSize(2, 'static');
|
|
607
|
-
content: '';
|
|
608
|
-
height: core-functions-v3.fluidSize(22, 'static');
|
|
609
|
-
right: core-functions-v3.fluidSize(2, 'static');
|
|
610
|
-
position: absolute;
|
|
611
|
-
transition: 0.4s;
|
|
612
|
-
width: core-functions-v3.fluidSize(22, 'static');
|
|
613
|
-
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
614
|
-
height: core-functions-v3.fluidSize(30, 'static');
|
|
615
|
-
width: core-functions-v3.fluidSize(30, 'static');
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
input:checked + .switch-slider::before {
|
|
621
|
-
transform: translateX(core-functions-v3.fluidSize(-24, 'static'));
|
|
622
|
-
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
623
|
-
transform: translateX(
|
|
624
|
-
core-functions-v3.fluidSize(-34, 'static')
|
|
625
|
-
);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
input:checked + .switch-slider {
|
|
630
|
-
background-color: var(--palette-default-1);
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
&__switch-text {
|
|
635
|
-
color: var(--palette-default-5);
|
|
636
|
-
font-family: var(--tertiary-font-family);
|
|
637
|
-
font-size: core-functions-v3.fluidSize(10, 'static');
|
|
638
|
-
text-transform: uppercase;
|
|
639
|
-
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
640
|
-
font-size: core-functions-v3.fluidSize(11, 'static');
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
548
|
|
|
644
549
|
&__grid {
|
|
645
550
|
grid-area: grid;
|
|
@@ -714,24 +619,6 @@
|
|
|
714
619
|
z-index: 1;
|
|
715
620
|
grid-row: var(--gradient-overlay-row-start, 1) /
|
|
716
621
|
var(--gradient-overlay-row-end, -1);
|
|
717
|
-
|
|
718
|
-
&--gradient-overlay-top,
|
|
719
|
-
&--gradient-overlay-right,
|
|
720
|
-
&--gradient-overlay-bottom,
|
|
721
|
-
&--gradient-overlay-left {
|
|
722
|
-
// @include core-gradient-designer.gradientDesigner();
|
|
723
|
-
position: absolute;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
&--gradient-overlay-vertical {
|
|
727
|
-
// @include core-gradient-designer.gradientDesignerVertical();
|
|
728
|
-
position: absolute;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
&--gradient-overlay-horizontal {
|
|
732
|
-
// @include core-gradient-designer.gradientDesignerHorizontal();
|
|
733
|
-
position: absolute;
|
|
734
|
-
}
|
|
735
622
|
}
|
|
736
623
|
|
|
737
624
|
&__post-image-container-link {
|
|
@@ -767,13 +654,6 @@
|
|
|
767
654
|
&__info-item {
|
|
768
655
|
@include grid-layout-element-v3.gridLayoutElement();
|
|
769
656
|
z-index: 2;
|
|
770
|
-
|
|
771
|
-
&:not(.post-type-filter-grid-v3__post-link, .post-type-filter-grid-v3__product-buy-now, .post-type-filter-grid-v3__post-image-container-link, .post-type-filter-grid-v3__post-tags, .post-type-filter-grid-v3__shopify) {
|
|
772
|
-
* {
|
|
773
|
-
width: 100%;
|
|
774
|
-
// @include core-mixins-v3.textStyle();
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
657
|
}
|
|
778
658
|
|
|
779
659
|
&__post-tags {
|
|
@@ -851,7 +731,6 @@
|
|
|
851
731
|
}
|
|
852
732
|
&__post-headline {
|
|
853
733
|
width: 100%;
|
|
854
|
-
// @include core-mixins-v3.textStyle();
|
|
855
734
|
}
|
|
856
735
|
&__post-title-icon {
|
|
857
736
|
width: 1em;
|
|
@@ -1036,10 +915,6 @@
|
|
|
1036
915
|
}
|
|
1037
916
|
|
|
1038
917
|
&__show-all {
|
|
1039
|
-
&[data-layout='5'] {
|
|
1040
|
-
text-align: left;
|
|
1041
|
-
justify-content: flex-start;
|
|
1042
|
-
}
|
|
1043
918
|
z-index: 2;
|
|
1044
919
|
position: relative;
|
|
1045
920
|
width: auto;
|
|
@@ -1051,14 +926,6 @@
|
|
|
1051
926
|
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
1052
927
|
width: initial;
|
|
1053
928
|
}
|
|
1054
|
-
|
|
1055
|
-
@include core-mixins-v3.device(breakpoints.$tabLandscape) {
|
|
1056
|
-
&[data-layout='2'],
|
|
1057
|
-
&[data-layout='5'] {
|
|
1058
|
-
grid-column: 1;
|
|
1059
|
-
width: max-content;
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
929
|
}
|
|
1063
930
|
|
|
1064
931
|
// filter elements transition effect. If more effects are needed, add them in ACF and replace 'fade' in css by new transition name
|
|
@@ -14,12 +14,7 @@
|
|
|
14
14
|
v-on:click.prevent="clearAllFilters()" :data-layout="filterLayout">
|
|
15
15
|
{{ showAllText }}
|
|
16
16
|
</button>
|
|
17
|
-
<div
|
|
18
|
-
filterLayout == 1 ||
|
|
19
|
-
filterLayout == 2 ||
|
|
20
|
-
filterLayout == 4 ||
|
|
21
|
-
filterLayout == 5
|
|
22
|
-
" :class="`${blockClassName}__filter-categories`" :data-layout="filterLayout">
|
|
17
|
+
<div :class="`${blockClassName}__filter-categories`" :data-layout="filterLayout">
|
|
23
18
|
<div v-if="filterLayout == 4" :class="`${blockClassName}__filter-categories-label`">
|
|
24
19
|
{{ categoriesTitleText }}
|
|
25
20
|
<button @click="modalOpen = !modalOpen"></button>
|
|
@@ -89,17 +84,6 @@
|
|
|
89
84
|
</ul>
|
|
90
85
|
</div>
|
|
91
86
|
<div :class="`${blockClassName}__filter-subcategories-container`">
|
|
92
|
-
<!-- <ul v-if="enablePlaceholderFilter">
|
|
93
|
-
<li :class="`${blockClassName}__filter-subcategory-list-item ${placeholderFilterActiveStatus ? 'active' : ''}`"
|
|
94
|
-
v-if="enablePlaceholderFilter" data-categoryid="placeholder">
|
|
95
|
-
<button
|
|
96
|
-
:class="`${blockClassName}__filter-subcategory-button ${placeholderFilterActiveStatus ? 'active' : ''} cmpl-cta-style-${categoryButtonStyle}`">
|
|
97
|
-
Choose country <img v-if="enableFilterIcon" :src="ctaIcons.cta_filter_icon"
|
|
98
|
-
:class="`${blockClassName}__filter-subcategory-button-icon style-svg`">
|
|
99
|
-
</button>
|
|
100
|
-
|
|
101
|
-
</li>
|
|
102
|
-
</ul>-->
|
|
103
87
|
<ul v-for="(topCategory, index) in computedCategories?.topLevelCategories" v-bind:key="index"
|
|
104
88
|
@click="toggleSubcategoryListContainer(topCategory?.term_id)" :class="`${blockClassName}__filter-subcategory-list ${topLevelCategoryActiveStatus(topCategory?.term_id)
|
|
105
89
|
? blockClassName + '__filter-subcategory-list--active'
|
|
@@ -127,28 +111,6 @@
|
|
|
127
111
|
</div>
|
|
128
112
|
</div>
|
|
129
113
|
|
|
130
|
-
<div :class="`${blockClassName}__featured-post`" v-if="enableFeaturedPost && activeFilterCategories.length < 1"
|
|
131
|
-
:style="featuredPostBackgroundColour">
|
|
132
|
-
<TransitionGroup>
|
|
133
|
-
<div :class="`${blockClassName}__featured-post-container`" v-if="featuredPost">
|
|
134
|
-
<FeaturedPostComponent :featuredpost="featuredPost" :fields="fields" :options="options"
|
|
135
|
-
:mappedIcons="mappedIcons" :ctaStyles="ctaStyles" :ctaIcons="ctaIcons">
|
|
136
|
-
</FeaturedPostComponent>
|
|
137
|
-
</div>
|
|
138
|
-
</TransitionGroup>
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
<div :class="`${blockClassName}__market-toggle`" v-if="showMarketToggle">
|
|
142
|
-
<div :class="`${blockClassName}__switch`">
|
|
143
|
-
<span :class="`${blockClassName}__switch-text`">All Products</span>
|
|
144
|
-
<label :class="`${blockClassName}__switch-toggle`">
|
|
145
|
-
<input type="checkbox" v-model="showAllMarkets" @change="onMarketToggle" />
|
|
146
|
-
<span class="switch-slider"></span>
|
|
147
|
-
</label>
|
|
148
|
-
<span :class="`${blockClassName}__switch-text`">Local Products</span>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
|
|
152
114
|
<div :class="`${blockClassName}__grid`">
|
|
153
115
|
<TransitionGroup :name="fields.filter_results_transition">
|
|
154
116
|
<div :class="`${blockClassName}__post-container`" :style="`
|
|
@@ -191,14 +153,7 @@
|
|
|
191
153
|
|
|
192
154
|
<script setup>
|
|
193
155
|
import { ref, reactive, onMounted, useAttrs, computed, watch } from "vue";
|
|
194
|
-
// import likes from "WpPlugins/cbl-better-reviews/public/src/modules/likes.js";
|
|
195
|
-
// import reviews from "WpPlugins/cbl-better-reviews/public/src/modules/reviews.js";
|
|
196
|
-
// import shop from "Assets/js/modules/library-modules/shopify/shop.js";
|
|
197
|
-
// import reviewModal from "WpPlugins/cbl-better-reviews/public/src/modules/review-modal.js";
|
|
198
|
-
// import reservebarPopup from "Assets/js/modules/library-modules/reservebar-popup/reservebar-popup.js";
|
|
199
|
-
// import { isWpAdmin, ctbCTAClickHandler } from "@pernod-ricard-global-cms/jsutils";
|
|
200
156
|
import PostComponent from "./post-type-filter-grid-v3/post-component.vue";
|
|
201
|
-
import FeaturedPostComponent from "./post-type-filter-grid-v3/featured-post-component.vue";
|
|
202
157
|
import TextSearch from "./post-type-filter-grid-v3/text-search.vue";
|
|
203
158
|
|
|
204
159
|
// get content data from window
|
|
@@ -247,7 +202,6 @@ const allPosts = reactive({ items: ptfgData.posts });
|
|
|
247
202
|
const allProducts = ptfgData.allProducts;
|
|
248
203
|
const postDataConfig = ptfgData.postDataConfig;
|
|
249
204
|
const allCategories = ptfgData.taxonomies;
|
|
250
|
-
const featuredPost = ptfgData.featuredPost;
|
|
251
205
|
const mappedIcons = ptfgData.mappedIcons;
|
|
252
206
|
const ctaStyles = ptfgData.ctaStyles;
|
|
253
207
|
const totalPosts = ptfgData.total;
|
|
@@ -269,17 +223,15 @@ const topLevelCategoryButtonStyle = fields.top_level_category_button_style
|
|
|
269
223
|
.replace("__", "");
|
|
270
224
|
const categoryButtonStyle = fields.category_button_style?.toString().replace("__", "");
|
|
271
225
|
const loadMoreButtonStyle = fields.load_more_button_style?.toString().replace("__", "");
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const loadMoreAnimationStyle = 1;
|
|
226
|
+
const loadMoreAnimationStyle =
|
|
227
|
+
ctaStyles[parseInt(loadMoreButtonStyle) - 1]?.cta_settings
|
|
228
|
+
?.cta_animation_style;
|
|
276
229
|
const toggleFilterButtonStyle = fields.toggle_filter_button_style
|
|
277
230
|
?.toString()
|
|
278
231
|
.replace("__", "");
|
|
279
232
|
const showAllButtonStyle = fields.show_all_button_style?.toString().replace("__", "");
|
|
280
233
|
const enableLoadMoreButton = fields.enable_load_more_button;
|
|
281
234
|
const showFilters = fields.show_filters;
|
|
282
|
-
const showMarketToggle = fields.show_market_toggle;
|
|
283
235
|
const showTopLevelFilters = fields.show_top_level_filters;
|
|
284
236
|
const topLevelFiltersActiveOnLoad = fields.top_level_filters_active_on_load;
|
|
285
237
|
const singleActiveTopLevelCategory = fields.single_active_top_level_category;
|
|
@@ -304,10 +256,7 @@ const enableFilterIcon = fields.enable_filter_icon;
|
|
|
304
256
|
const enableTopLevelFilterIcon = fields.enable_top_level_filter_icon;
|
|
305
257
|
const enableStartingFilter = fields.enable_starting_filter;
|
|
306
258
|
const enablePlaceholderFilter = fields.enable_placeholder_filter;
|
|
307
|
-
const enableShopify = JSON.parse(localStorage.getItem("enableShopify"));
|
|
308
259
|
const placeholderFilterText = fields.placeholder_filter_text;
|
|
309
|
-
const enableFeaturedPost = fields.enable_featured_post;
|
|
310
|
-
const featuredPostBackgroundColour = `--featured-post-background-colour: ${fields.featured_post_background_colour}`;
|
|
311
260
|
const initialPostsPerPageDesktop = fields.initial_posts_per_page_desktop;
|
|
312
261
|
const initialPostsPerPageTablet = fields.initial_posts_per_page_portrait;
|
|
313
262
|
const initialPostsPerPageMobile = fields.initial_posts_per_page_mobile;
|
|
@@ -315,16 +264,6 @@ const postsPerPageDesktop = showAllPosts ? 999999 : Number(fields.posts_per_page
|
|
|
315
264
|
const postsPerPageTablet = showAllPosts ? 999999 : Number(fields.posts_per_page_tablet);
|
|
316
265
|
const postsPerPageMobile = showAllPosts ? 999999 : Number(fields.posts_per_page_mobile);
|
|
317
266
|
const loadedCategories = [];
|
|
318
|
-
const subFilterOverflowMobileValue = fields.sub_filter_overflow ? fields.sub_filter_overflow.mobile_overflow.toString().replace("__", "") : 'scroll';
|
|
319
|
-
const subFilterOverflowTabletValue = fields.sub_filter_overflow ? fields.sub_filter_overflow.tablet_overflow.toString().replace("__", "") : 'scroll';
|
|
320
|
-
const subFilterOverflowDesktopValue = fields.sub_filter_overflow ? fields.sub_filter_overflow.desktop_overflow.toString().replace("__", "") : 'scroll';
|
|
321
|
-
const subFilterOverflowMobile = `--sub-filter-overflow-mobile: ${subFilterOverflowMobileValue};`;
|
|
322
|
-
const subFilterOverflowTablet = `--sub-filter-overflow-tablet: ${subFilterOverflowTabletValue};`;
|
|
323
|
-
const subFilterOverflowDesktop = `--sub-filter-overflow-desktop: ${subFilterOverflowDesktopValue};`;
|
|
324
|
-
const subFilterOverflowCenterMobile = `--sub-filter-overflow-center-mobile: ${subFilterOverflowMobileValue === 'wrap' ? 'center' : ''};`;
|
|
325
|
-
const subFilterOverflowCenterTablet = `--sub-filter-overflow-center-tablet: ${subFilterOverflowTabletValue === 'wrap' ? 'center' : ''};`;
|
|
326
|
-
const subFilterOverflowCenterDesktop = `--sub-filter-overflow-center-desktop: ${subFilterOverflowDesktopValue === 'wrap' ? 'center' : ''};`;
|
|
327
|
-
const subFilterOverflowStyles = subFilterOverflowMobile + subFilterOverflowTablet + subFilterOverflowDesktop + subFilterOverflowCenterMobile + subFilterOverflowCenterTablet + subFilterOverflowCenterDesktop
|
|
328
267
|
|
|
329
268
|
let devicePostsPerPage = postsPerPageDesktop;
|
|
330
269
|
let deviceInitialPostsPerPage = initialPostsPerPageDesktop;
|
|
@@ -365,11 +304,6 @@ const computedAllPosts = computed(() => {
|
|
|
365
304
|
});
|
|
366
305
|
const computedFilteredPosts = computed(() => {
|
|
367
306
|
let computedPosts = computedAllPosts.value;
|
|
368
|
-
if (enableFeaturedPost) {
|
|
369
|
-
computedPosts = computedAllPosts.value.filter(
|
|
370
|
-
(post) => post.post_data.ID != fields.featured_post
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
307
|
const posts = filterPosts(computedPosts, activeFilterCategories.value);
|
|
374
308
|
return sortPosts(posts);
|
|
375
309
|
});
|
|
@@ -406,13 +340,6 @@ const resetPage = () => {
|
|
|
406
340
|
window.history.pushState({}, "", path);
|
|
407
341
|
};
|
|
408
342
|
|
|
409
|
-
const computedFeaturedPost = computed(() => {
|
|
410
|
-
const featuredPost = computedAllPosts.value.filter(
|
|
411
|
-
(post) => post.id == fields.featured_post
|
|
412
|
-
);
|
|
413
|
-
const [post] = featuredPost;
|
|
414
|
-
return post;
|
|
415
|
-
});
|
|
416
343
|
|
|
417
344
|
const computedProducts = computed(() => {
|
|
418
345
|
// const updatedProducts = [];
|
|
@@ -522,14 +449,6 @@ const filterPosts = (posts, filterCategoryIds = activeFilterCategories.value) =>
|
|
|
522
449
|
});
|
|
523
450
|
}
|
|
524
451
|
filteredPosts = searchTerm == null ? filteredPosts : textFilteredPosts;
|
|
525
|
-
setTimeout(() => {
|
|
526
|
-
const gridContainer = document.querySelector(".post-type-filter-grid-v3__grid");
|
|
527
|
-
ctbCTAClickHandler(gridContainer);
|
|
528
|
-
reservebarPopup();
|
|
529
|
-
if (enableShopify) {
|
|
530
|
-
refreshShopifyBuyButtons();
|
|
531
|
-
}
|
|
532
|
-
}, 50);
|
|
533
452
|
|
|
534
453
|
return filteredPosts;
|
|
535
454
|
};
|
|
@@ -553,12 +472,7 @@ const incrementLoadMoreStatus = () => {
|
|
|
553
472
|
const url = new URL(window.location);
|
|
554
473
|
loadMoreStatus.value = Number(loadMoreStatus.value) + 1;
|
|
555
474
|
url.searchParams.set("pages", loadMoreStatus.value);
|
|
556
|
-
|
|
557
|
-
reviews.init();
|
|
558
|
-
if (enableShopify) {
|
|
559
|
-
refreshShopifyBuyButtons();
|
|
560
|
-
}
|
|
561
|
-
}, 0);
|
|
475
|
+
|
|
562
476
|
if (!isWpAdmin()) {
|
|
563
477
|
window.history.pushState({}, "", url);
|
|
564
478
|
}
|
|
@@ -805,7 +719,7 @@ const loadMorePosts = async (currentCategoryId = null, { replace = false } = {})
|
|
|
805
719
|
form_data.append("includeReviews", ptfgData.includeReviews);
|
|
806
720
|
form_data.append("reviewDisplayOptions", ptfgData.reviewDisplayOptions);
|
|
807
721
|
form_data.append("limitPostsToSelectedCategories", fields.limit_posts_to_selected_categories);
|
|
808
|
-
form_data.append("currentMarket",
|
|
722
|
+
form_data.append("currentMarket", ptfgData.currentMarket);
|
|
809
723
|
|
|
810
724
|
form_data.append(
|
|
811
725
|
"categoryIds",
|
|
@@ -839,12 +753,7 @@ const loadMorePosts = async (currentCategoryId = null, { replace = false } = {})
|
|
|
839
753
|
];
|
|
840
754
|
allPosts.items = sortPosts(mergedArray); // Merge as usual
|
|
841
755
|
}
|
|
842
|
-
|
|
843
|
-
reviews.init();
|
|
844
|
-
if (enableShopify) {
|
|
845
|
-
refreshShopifyBuyButtons();
|
|
846
|
-
}
|
|
847
|
-
}, 0);
|
|
756
|
+
|
|
848
757
|
isLoading.value = false;
|
|
849
758
|
}
|
|
850
759
|
} catch (e) {
|
|
@@ -892,47 +801,9 @@ const scrollBackToStart = () => {
|
|
|
892
801
|
}
|
|
893
802
|
}
|
|
894
803
|
|
|
895
|
-
const refreshShopifyBuyButtons = () => {
|
|
896
|
-
postDataConfig.forEach((item) => {
|
|
897
|
-
if (item.acf_fc_layout === "shopify_add_to_cart") {
|
|
898
|
-
document.dispatchEvent(
|
|
899
|
-
new Event('shop-refresh')
|
|
900
|
-
)
|
|
901
|
-
}
|
|
902
|
-
})
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
const showAllMarkets = ref(false);
|
|
906
|
-
const onMarketToggle = async () => {
|
|
907
|
-
isLoading.value = true;
|
|
908
|
-
page.value = 1;
|
|
909
|
-
resetPage();
|
|
910
|
-
const previousPosts = [...allPosts.items];
|
|
911
|
-
try {
|
|
912
|
-
await loadMorePosts(null, { replace: true });
|
|
913
|
-
isLoading.value = false;
|
|
914
|
-
} catch (e) {
|
|
915
|
-
console.error("Market toggle failed:", e);
|
|
916
|
-
allPosts.items = previousPosts;
|
|
917
|
-
isLoading.value = false;
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
|
|
921
804
|
onMounted(() => {
|
|
922
805
|
getLoadMoreStatusParam();
|
|
923
806
|
setupFilterLayout();
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
setTimeout(() => {
|
|
928
|
-
reviews.init();
|
|
929
|
-
if (enableShopify) {
|
|
930
|
-
shop.loadShops();
|
|
931
|
-
refreshShopifyBuyButtons();
|
|
932
|
-
}
|
|
933
|
-
if (!allPosts.items.length) {
|
|
934
|
-
loadMorePosts();
|
|
935
|
-
}
|
|
936
|
-
}, 500);
|
|
807
|
+
loadMorePosts();
|
|
937
808
|
});
|
|
938
809
|
</script>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
{# Do not edit this file outside of the component library as your changes will be lost with future updates. #}
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
{% set paddingVertMultiplierDesktopTop = "--padding-block-multiplier-desktop-top: 0;" %}
|
|
5
2
|
{% set paddingVertMultiplierDesktopBottom = "--padding-block-multiplier-desktop-bottom: 0;" %}
|
|
6
3
|
{% set paddingHorizMultiplierDesktopRight = "--padding-inline-multiplier-desktop-right: 0;" %}
|
|
@@ -18,35 +15,18 @@
|
|
|
18
15
|
{% set paddingVertMultiplierMobile = "--padding-block-multiplier-mobile: 0;" %}
|
|
19
16
|
|
|
20
17
|
{% if fields.enable_block_padding %}
|
|
21
|
-
{% set
|
|
22
|
-
{% set
|
|
23
|
-
{% set
|
|
24
|
-
{% set
|
|
25
|
-
{% set
|
|
26
|
-
{% set
|
|
27
|
-
{% set
|
|
28
|
-
{% set
|
|
29
|
-
{% set
|
|
30
|
-
{% set
|
|
31
|
-
{% set
|
|
32
|
-
{% set
|
|
33
|
-
{% set paddingHorizMultiplierMobileRight = "--padding-inline-multiplier-mobile-right:" ~ fields.block_horizontal_padding_mobile ~ ";" %}
|
|
34
|
-
{% set paddingHorizMultiplierMobileLeft = "--padding-inline-multiplier-mobile-left:" ~ fields.block_horizontal_padding_mobile ~ ";" %}
|
|
35
|
-
{% set paddingVertMultiplierMobile = "--padding-block-multiplier-mobile:" ~ fields.block_vertical_padding_mobile ~ ";" %}
|
|
36
|
-
{% if fields.enable_advanced_block_padding_controls %}
|
|
37
|
-
{% set paddingVertMultiplierMobileTop = "--padding-block-multiplier-mobile-top:" ~ fields.block_vertical_padding_mobile_top ~ ";" %}
|
|
38
|
-
{% set paddingVertMultiplierMobileBottom = "--padding-block-multiplier-mobile-bottom:" ~ fields.block_vertical_padding_mobile_bottom ~ ";" %}
|
|
39
|
-
{% set paddingHorizMultiplierMobileRight = "--padding-inline-multiplier-mobile-right:" ~ fields.block_horizontal_padding_mobile_right ~ ";" %}
|
|
40
|
-
{% set paddingHorizMultiplierMobileLeft = "--padding-inline-multiplier-mobile-left:" ~ fields.block_horizontal_padding_mobile_left ~ ";" %}
|
|
41
|
-
{% set paddingVertMultiplierPortraitTop = "--padding-block-multiplier-portrait-top:" ~ fields.block_vertical_padding_portrait_top ~ ";" %}
|
|
42
|
-
{% set paddingVertMultiplierPortraitBottom = "--padding-block-multiplier-portrait-bottom:" ~ fields.block_vertical_padding_portrait_bottom ~ ";" %}
|
|
43
|
-
{% set paddingHorizMultiplierPortraitRight = "--padding-inline-multiplier-portrait-right:" ~ fields.block_horizontal_padding_portrait_right ~ ";" %}
|
|
44
|
-
{% set paddingHorizMultiplierPortraitLeft = "--padding-inline-multiplier-portrait-left:" ~ fields.block_horizontal_padding_portrait_left ~ ";" %}
|
|
45
|
-
{% set paddingVertMultiplierDesktopTop = "--padding-block-multiplier-desktop-top:" ~ fields.block_vertical_padding_desktop_top ~ ";" %}
|
|
46
|
-
{% set paddingVertMultiplierDesktopBottom = "--padding-block-multiplier-desktop-bottom:" ~ fields.block_vertical_padding_desktop_bottom ~ ";" %}
|
|
47
|
-
{% set paddingHorizMultiplierDesktopRight = "--padding-inline-multiplier-desktop-right:" ~ fields.block_horizontal_padding_desktop_right ~ ";" %}
|
|
48
|
-
{% set paddingHorizMultiplierDesktopLeft = "--padding-inline-multiplier-desktop-left:" ~ fields.block_horizontal_padding_desktop_left ~ ";" %}
|
|
49
|
-
{% endif %}
|
|
18
|
+
{% set paddingVertMultiplierMobileTop = "--padding-block-multiplier-mobile-top:" ~ fields.block_vertical_padding_mobile_top ~ ";" %}
|
|
19
|
+
{% set paddingVertMultiplierMobileBottom = "--padding-block-multiplier-mobile-bottom:" ~ fields.block_vertical_padding_mobile_bottom ~ ";" %}
|
|
20
|
+
{% set paddingHorizMultiplierMobileRight = "--padding-inline-multiplier-mobile-right:" ~ fields.block_horizontal_padding_mobile_right ~ ";" %}
|
|
21
|
+
{% set paddingHorizMultiplierMobileLeft = "--padding-inline-multiplier-mobile-left:" ~ fields.block_horizontal_padding_mobile_left ~ ";" %}
|
|
22
|
+
{% set paddingVertMultiplierPortraitTop = "--padding-block-multiplier-portrait-top:" ~ fields.block_vertical_padding_portrait_top ~ ";" %}
|
|
23
|
+
{% set paddingVertMultiplierPortraitBottom = "--padding-block-multiplier-portrait-bottom:" ~ fields.block_vertical_padding_portrait_bottom ~ ";" %}
|
|
24
|
+
{% set paddingHorizMultiplierPortraitRight = "--padding-inline-multiplier-portrait-right:" ~ fields.block_horizontal_padding_portrait_right ~ ";" %}
|
|
25
|
+
{% set paddingHorizMultiplierPortraitLeft = "--padding-inline-multiplier-portrait-left:" ~ fields.block_horizontal_padding_portrait_left ~ ";" %}
|
|
26
|
+
{% set paddingVertMultiplierDesktopTop = "--padding-block-multiplier-desktop-top:" ~ fields.block_vertical_padding_desktop_top ~ ";" %}
|
|
27
|
+
{% set paddingVertMultiplierDesktopBottom = "--padding-block-multiplier-desktop-bottom:" ~ fields.block_vertical_padding_desktop_bottom ~ ";" %}
|
|
28
|
+
{% set paddingHorizMultiplierDesktopRight = "--padding-inline-multiplier-desktop-right:" ~ fields.block_horizontal_padding_desktop_right ~ ";" %}
|
|
29
|
+
{% set paddingHorizMultiplierDesktopLeft = "--padding-inline-multiplier-desktop-left:" ~ fields.block_horizontal_padding_desktop_left ~ ";" %}
|
|
50
30
|
{% endif %}
|
|
51
31
|
|
|
52
32
|
{% set blockPaddingString = paddingVertMultiplierDesktop ~ paddingVertMultiplierDesktopTop ~ paddingVertMultiplierDesktopBottom ~ paddingHorizMultiplierDesktopRight ~ paddingHorizMultiplierDesktopLeft ~ paddingVertMultiplierMobileTop ~ paddingVertMultiplierMobileBottom ~ paddingHorizMultiplierMobileLeft ~ paddingHorizMultiplierMobileRight ~ paddingVertMultiplierMobile ~ paddingVertMultiplierPortraitTop ~ paddingVertMultiplierPortraitBottom ~ paddingHorizMultiplierPortraitLeft ~ paddingHorizMultiplierPortraitRight ~ paddingVertMultiplierPortrait %}
|