added company based filter and user meta

This commit is contained in:
2026-02-17 10:55:50 +01:00
parent 9ea053986d
commit f505687b16
5 changed files with 117 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ class PartnerExpoSearch {
drawerBackdrop: document.getElementById("pexpo-core-drawerBackdrop"),
filterFTag: document.getElementById("pexpo-core-tag-toggle"),
filterTags: document.getElementById("pexpo-core-tags"),
filterCompanies: document.getElementById("pexpo-core-companies"),
qInput: document.getElementById("pexpo-core-q"),
masonry: document.getElementById("pexpo-core-masonry"),
measure: document.getElementById("pexpo-core-measure"),
@@ -33,6 +34,7 @@ class PartnerExpoSearch {
sort: "relevance",
force_tags: false,
tags: [],
companies: [],
resultsPerPage: 20,
page: 1,
},
@@ -72,7 +74,6 @@ class PartnerExpoSearch {
initMultiSelect() {
if (typeof MultiSelect !== 'undefined') {
new MultiSelect(this.els.filterTags, {
placeholder: 'Címkék kiválasztása',
search: true,
selectAll: false,
onSelect: (value) => {
@@ -84,6 +85,19 @@ class PartnerExpoSearch {
this.state.filters.tags = this.state.filters.tags.filter(tag => tag !== value);
}
});
new MultiSelect(this.els.filterCompanies, {
search: true,
selectAll: false,
onSelect: (value) => {
if (!this.state.filters.companies.includes(value)) {
this.state.filters.companies.push(value);
}
},
onUnselect: (value) => {
this.state.filters.companies = this.state.filters.companies.filter(company => company !== value);
}
});
} else {
console.warn("MultiSelect library not found.");
}