sr-npm 1.7.711 → 1.7.713
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
CHANGED
|
@@ -35,26 +35,15 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
35
35
|
let applyFiltering=false;
|
|
36
36
|
if(urlParams.brand) {
|
|
37
37
|
const brandValue = decodeURIComponent(urlParams.brand);
|
|
38
|
-
console.log("brandValue: ", brandValue);
|
|
39
|
-
console.log("selectedByField: ", selectedByField);
|
|
40
|
-
console.log("optionsByFieldId: ", optionsByFieldId);
|
|
41
|
-
console.log("allfields: ", allfields);
|
|
42
38
|
const field=getFieldByTitle(fieldTitlesInCMS.brand,allfields);
|
|
43
|
-
console.log("field: ", field);
|
|
44
39
|
const options=optionsByFieldId.get(field._id);
|
|
45
|
-
console.log("all the options: are ", options);
|
|
46
40
|
const option=getCorrectOption(brandValue,options);
|
|
47
|
-
console.log("the correctoption: ", option);
|
|
48
41
|
if(option) {
|
|
49
|
-
console.log("setting the value of the checkbox to: ", option.value);
|
|
50
|
-
|
|
51
|
-
// _$w(`#${FiltersIds[field.title]}CheckBox`).value = [option.value];
|
|
52
42
|
const optionIndex=getOptionIndexFromCheckBox(_$w(`#${FiltersIds[field.title]}CheckBox`).options,option.value);
|
|
53
|
-
console.log("optionIndex: ", optionIndex);
|
|
54
|
-
|
|
55
43
|
_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = [optionIndex];
|
|
56
44
|
selectedByField.set(field._id, [option.value]);
|
|
57
45
|
applyFiltering=true;
|
|
46
|
+
dontUpdateThisCheckBox=field._id;
|
|
58
47
|
}
|
|
59
48
|
else {
|
|
60
49
|
console.warn("brand value not found in dropdown options");
|
|
@@ -62,27 +51,23 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
62
51
|
}
|
|
63
52
|
if(urlParams.category) {
|
|
64
53
|
const categoryValue = decodeURIComponent(urlParams.category);
|
|
65
|
-
console.log("categoryValue: ", categoryValue);
|
|
66
|
-
console.log("selectedByField: ", selectedByField);
|
|
67
|
-
console.log("optionsByFieldId: ", optionsByFieldId);
|
|
68
|
-
console.log("allfields: ", allfields);
|
|
69
54
|
const field=getFieldByTitle(fieldTitlesInCMS.category,allfields);
|
|
70
|
-
console.log("field: ", field);
|
|
71
55
|
const options=optionsByFieldId.get(field._id);
|
|
72
|
-
console.log("all the options: are ", options);
|
|
73
56
|
const option=getCorrectOption(categoryValue,options);
|
|
74
|
-
console.log("the correctoption: ", option);
|
|
75
57
|
if(option) {
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
const optionIndex=getOptionIndexFromCheckBox(_$w(`#${FiltersIds[field.title]}CheckBox`).options,option.value);
|
|
59
|
+
_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = [optionIndex];
|
|
78
60
|
selectedByField.set(field._id, [option.value]);
|
|
79
61
|
applyFiltering=true
|
|
80
|
-
|
|
62
|
+
dontUpdateThisCheckBox=field._id;
|
|
81
63
|
}
|
|
82
64
|
else {
|
|
83
65
|
console.warn("category value not found in dropdown options");
|
|
84
66
|
}
|
|
85
67
|
}
|
|
68
|
+
if(urlParams.keyword) {
|
|
69
|
+
console.log("keyword urlparam handling coming soon...")
|
|
70
|
+
}
|
|
86
71
|
if(applyFiltering) {
|
|
87
72
|
await updateJobsAndNumbersAndFilters(_$w);
|
|
88
73
|
}
|
|
@@ -109,7 +94,6 @@ async function loadPaginationButtons(_$w) {
|
|
|
109
94
|
async function loadSelectedValuesRepeater(_$w) {
|
|
110
95
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).onItemReady(($item, itemData) => {
|
|
111
96
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER_ITEM_LABEL).text = itemData.label || '';
|
|
112
|
-
|
|
113
97
|
// Deselect this value from both the selected map and the multibox
|
|
114
98
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.DESELECT_BUTTON_ID).onClick(async () => {
|
|
115
99
|
|
|
@@ -117,7 +101,7 @@ async function loadSelectedValuesRepeater(_$w) {
|
|
|
117
101
|
const valueId = itemData.valueId;
|
|
118
102
|
dontUpdateThisCheckBox=fieldId;
|
|
119
103
|
if (!fieldId || !valueId) return;
|
|
120
|
-
|
|
104
|
+
|
|
121
105
|
const existing = selectedByField.get(fieldId) || [];
|
|
122
106
|
const updated = existing.filter(v => v !== valueId);
|
|
123
107
|
if (updated.length) {
|
|
@@ -127,13 +111,9 @@ async function loadSelectedValuesRepeater(_$w) {
|
|
|
127
111
|
}
|
|
128
112
|
|
|
129
113
|
const field=getFieldById(fieldId,allfields);
|
|
130
|
-
|
|
131
|
-
|
|
132
114
|
const currentVals = _$w(`#${FiltersIds[field.title]}CheckBox`).value || [];
|
|
133
115
|
const nextVals = currentVals.filter(v => v !== valueId);
|
|
134
116
|
_$w(`#${FiltersIds[field.title]}CheckBox`).value = nextVals;
|
|
135
|
-
|
|
136
|
-
|
|
137
117
|
await updateJobsAndNumbersAndFilters(_$w);
|
|
138
118
|
});
|
|
139
119
|
});
|