sr-npm 1.7.485 → 1.7.486
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 +16 -4
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -36,6 +36,7 @@ await activateAutoLoad(_$w);
|
|
|
36
36
|
await bind(_$w);
|
|
37
37
|
await init(_$w);
|
|
38
38
|
await handleUrlParams(_$w);
|
|
39
|
+
await handleBrandDropdown(_$w);
|
|
39
40
|
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -171,7 +172,7 @@ function init(_$w) {
|
|
|
171
172
|
searchInputBlurredFirstTime=false;
|
|
172
173
|
}
|
|
173
174
|
});
|
|
174
|
-
_$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>{
|
|
175
|
+
_$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType, #dropdownBrand').onChange(()=>{
|
|
175
176
|
console.log("dropdown onChange is triggered");
|
|
176
177
|
applyFilters(_$w);
|
|
177
178
|
});
|
|
@@ -237,6 +238,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
237
238
|
{ elementId: '#dropdownDepartment', field: 'department', value: _$w('#dropdownDepartment').value },
|
|
238
239
|
{ elementId: '#dropdownLocation', field: 'cityText', value: _$w('#dropdownLocation').value },
|
|
239
240
|
{ elementId: '#dropdownJobType', field: 'remote', value: _$w('#dropdownJobType').value},
|
|
241
|
+
{ elementId: '#dropdownBrand', field: 'brand', value: _$w('#dropdownBrand').value},
|
|
240
242
|
{ elementId: '#searchInput', field: 'title', value: _$w('#searchInput').value }
|
|
241
243
|
];
|
|
242
244
|
console.log("dropdownFiltersMapping: ", dropdownFiltersMapping);
|
|
@@ -298,6 +300,10 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
298
300
|
console.log("removing jobType from url")
|
|
299
301
|
queryParams.remove(["jobType" ]);
|
|
300
302
|
}
|
|
303
|
+
if(filter.field === 'brand'){
|
|
304
|
+
console.log("removing brand from url")
|
|
305
|
+
queryParams.remove(["brand" ]);
|
|
306
|
+
}
|
|
301
307
|
}
|
|
302
308
|
}
|
|
303
309
|
});
|
|
@@ -321,7 +327,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
321
327
|
}
|
|
322
328
|
|
|
323
329
|
async function resetFilters(_$w) {
|
|
324
|
-
_$w('#searchInput, #dropdownDepartment, #dropdownLocation, #dropdownJobType').value = '';
|
|
330
|
+
_$w('#searchInput, #dropdownDepartment, #dropdownLocation, #dropdownJobType, #dropdownBrand').value = '';
|
|
325
331
|
|
|
326
332
|
await _$w('#jobsDataset').setFilter(wixData.filter());
|
|
327
333
|
await _$w('#jobsDataset').refresh();
|
|
@@ -330,7 +336,7 @@ async function resetFilters(_$w) {
|
|
|
330
336
|
|
|
331
337
|
_$w('#resetFiltersButton').disable();
|
|
332
338
|
|
|
333
|
-
queryParams.remove(["keyWord", "department","page","location","jobType"]);
|
|
339
|
+
queryParams.remove(["keyWord", "department","page","location","jobType","brand"]);
|
|
334
340
|
|
|
335
341
|
|
|
336
342
|
await updateCount(_$w);
|
|
@@ -451,7 +457,13 @@ async function updateMapMarkers(_$w){
|
|
|
451
457
|
|
|
452
458
|
}
|
|
453
459
|
|
|
454
|
-
|
|
460
|
+
async function handleBrandDropdown(_$w){
|
|
461
|
+
const brands=await wixData.query("Brands").find();
|
|
462
|
+
if(brands.items.length>1){
|
|
463
|
+
console.log("showing brand dropdown");
|
|
464
|
+
_$w('#dropdownBrand').show();
|
|
465
|
+
}
|
|
466
|
+
}
|
|
455
467
|
module.exports = {
|
|
456
468
|
careersPageOnReady,
|
|
457
469
|
};
|