sr-npm 1.7.715 → 1.7.716
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/package.json +1 -1
- package/pages/careersMultiBoxesPage.js +20 -34
package/package.json
CHANGED
|
@@ -34,10 +34,25 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
|
34
34
|
async function handleUrlParams(_$w,urlParams) {
|
|
35
35
|
let applyFiltering=false;
|
|
36
36
|
if(urlParams.brand) {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
applyFiltering=await handleParams(_$w,"brand",urlParams.brand)
|
|
38
|
+
}
|
|
39
|
+
if(urlParams.category) {
|
|
40
|
+
applyFiltering=await handleParams(_$w,"category",urlParams.category)
|
|
41
|
+
}
|
|
42
|
+
if(urlParams.keyword) {
|
|
43
|
+
console.log("keyword urlparam handling coming soon...")
|
|
44
|
+
}
|
|
45
|
+
if(applyFiltering) {
|
|
46
|
+
await updateJobsAndNumbersAndFilters(_$w);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function handleParams(_$w,param,value) {
|
|
51
|
+
let applyFiltering=false;
|
|
52
|
+
const decodedValue = decodeURIComponent(value);
|
|
53
|
+
const field=getFieldByTitle(fieldTitlesInCMS[param],allfields);
|
|
39
54
|
const options=optionsByFieldId.get(field._id);
|
|
40
|
-
const option=getCorrectOption(
|
|
55
|
+
const option=getCorrectOption(decodedValue,options);
|
|
41
56
|
if(option) {
|
|
42
57
|
const optionIndex=getOptionIndexFromCheckBox(_$w(`#${FiltersIds[field.title]}CheckBox`).options,option.value);
|
|
43
58
|
_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = [optionIndex];
|
|
@@ -46,38 +61,9 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
46
61
|
dontUpdateThisCheckBox=field._id;
|
|
47
62
|
}
|
|
48
63
|
else {
|
|
49
|
-
console.warn(
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if(urlParams.category) {
|
|
53
|
-
const categoryValue = decodeURIComponent(urlParams.category);
|
|
54
|
-
const field=getFieldByTitle(fieldTitlesInCMS.category,allfields);
|
|
55
|
-
const options=optionsByFieldId.get(field._id);
|
|
56
|
-
const option=getCorrectOption(categoryValue,options);
|
|
57
|
-
if(option) {
|
|
58
|
-
const optionIndex=getOptionIndexFromCheckBox(_$w(`#${FiltersIds[field.title]}CheckBox`).options,option.value);
|
|
59
|
-
_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = [optionIndex];
|
|
60
|
-
selectedByField.set(field._id, [option.value]);
|
|
61
|
-
applyFiltering=true
|
|
62
|
-
if(dontUpdateThisCheckBox)
|
|
63
|
-
{
|
|
64
|
-
//to update the checkboxes after applying the filters
|
|
65
|
-
dontUpdateThisCheckBox=null;
|
|
66
|
-
}
|
|
67
|
-
else{
|
|
68
|
-
dontUpdateThisCheckBox=field._id;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
console.warn("category value not found in dropdown options");
|
|
64
|
+
console.warn(`${param} value not found in dropdown options`);
|
|
73
65
|
}
|
|
74
|
-
|
|
75
|
-
if(urlParams.keyword) {
|
|
76
|
-
console.log("keyword urlparam handling coming soon...")
|
|
77
|
-
}
|
|
78
|
-
if(applyFiltering) {
|
|
79
|
-
await updateJobsAndNumbersAndFilters(_$w);
|
|
80
|
-
}
|
|
66
|
+
return applyFiltering;
|
|
81
67
|
}
|
|
82
68
|
|
|
83
69
|
async function loadPaginationButtons(_$w) {
|