sr-npm 1.7.487 → 1.7.488
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/careersPage.js +34 -1
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -20,16 +20,18 @@ const {
|
|
|
20
20
|
let queryDepartmentVar;
|
|
21
21
|
let queryLocationVar;
|
|
22
22
|
let queryJobTypeVar;
|
|
23
|
+
let queryBrandVar;
|
|
23
24
|
let searchInputBlurredFirstTime=true;
|
|
24
25
|
let deletedParam=false;
|
|
25
26
|
async function careersPageOnReady(_$w,thisObject,queryParams) {
|
|
26
27
|
console.log("queryParams: ", queryParams);
|
|
27
|
-
const { page, keyWord, department, location,jobType } = queryParams;
|
|
28
|
+
const { page, keyWord, department, location,jobType,brand } = queryParams;
|
|
28
29
|
queryPageVar=page;
|
|
29
30
|
queryKeyWordVar=keyWord;
|
|
30
31
|
queryDepartmentVar=department;
|
|
31
32
|
queryLocationVar=location;
|
|
32
33
|
queryJobTypeVar=jobType;
|
|
34
|
+
queryBrandVar=brand;
|
|
33
35
|
thisObjectVar=thisObject;
|
|
34
36
|
allJobs=await getAllPositions();
|
|
35
37
|
await activateAutoLoad(_$w);
|
|
@@ -104,6 +106,9 @@ async function handleUrlParams(_$w) {
|
|
|
104
106
|
if (queryJobTypeVar) {
|
|
105
107
|
await handleJobTypeParam(_$w,queryJobTypeVar);
|
|
106
108
|
}
|
|
109
|
+
if (queryBrandVar && _$w('#dropdownBrand').isVisible()) { //if it is not visible, ignore it
|
|
110
|
+
await handleBrandParam(_$w,queryBrandVar);
|
|
111
|
+
}
|
|
107
112
|
await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
|
|
108
113
|
}
|
|
109
114
|
|
|
@@ -228,6 +233,16 @@ async function handleBackAndForth(_$w){
|
|
|
228
233
|
deletedParam=true;
|
|
229
234
|
_$w('#dropdownJobType').value = '';
|
|
230
235
|
}
|
|
236
|
+
if(_$w('#dropdownBrand').isVisible()){
|
|
237
|
+
if(newQueryParams.brand){
|
|
238
|
+
queryBrandVar=newQueryParams.brand;
|
|
239
|
+
}
|
|
240
|
+
else{
|
|
241
|
+
queryBrandVar=undefined;
|
|
242
|
+
deletedParam=true;
|
|
243
|
+
_$w('#dropdownBrand').value = '';
|
|
244
|
+
}
|
|
245
|
+
}
|
|
231
246
|
await handleUrlParams(_$w);
|
|
232
247
|
|
|
233
248
|
}
|
|
@@ -418,6 +433,24 @@ async function handleLocationParam(_$w,location) {
|
|
|
418
433
|
|
|
419
434
|
}
|
|
420
435
|
|
|
436
|
+
async function handleBrandParam(_$w,brand){
|
|
437
|
+
const brandValue = decodeURIComponent(brand);
|
|
438
|
+
let dropdownOptions = _$w('#dropdownBrand').options;
|
|
439
|
+
console.log("brand dropdown options:", dropdownOptions);
|
|
440
|
+
const optionsFromCMS=await wixData.query("Brands").find();
|
|
441
|
+
if(dropdownOptions.length!==optionsFromCMS.items.length+1){
|
|
442
|
+
fixDropdownOptions('#dropdownBrand',optionsFromCMS, _$w);
|
|
443
|
+
}
|
|
444
|
+
const option=_$w('#dropdownBrand').options.find(option => option.value.toLowerCase() === brandValue.toLowerCase())
|
|
445
|
+
if(option){
|
|
446
|
+
_$w('#dropdownBrand').value = option.value;
|
|
447
|
+
}
|
|
448
|
+
else{
|
|
449
|
+
console.warn("brand value not found in dropdown options");
|
|
450
|
+
queryParams.remove(["brand"]);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
421
454
|
async function handleJobTypeParam(_$w,jobType) {
|
|
422
455
|
const jobTypeValue = decodeURIComponent(jobType);
|
|
423
456
|
let dropdownOptions = _$w('#dropdownJobType').options;
|