sr-npm 1.7.1279 → 1.7.1281
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 +25 -14
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ let keywordAllJobs; // all jobs that are displayed in the jobs repeater when the
|
|
|
40
40
|
let ActivateURLOnchange=true; // whether to activate the url onchange
|
|
41
41
|
let considerAllJobs=false; // whether to consider all jobs or not
|
|
42
42
|
let urlOnchangeIsActive=false
|
|
43
|
+
let numbersofParamChanges=0;
|
|
43
44
|
let pageIsRemoved=false
|
|
44
45
|
const pagination = {
|
|
45
46
|
pageSize: 10,
|
|
@@ -80,7 +81,10 @@ async function handleBackAndForth(_$w){
|
|
|
80
81
|
ActivateURLOnchange=true;
|
|
81
82
|
}
|
|
82
83
|
else{
|
|
84
|
+
numbersofParamChanges--;
|
|
85
|
+
if(numbersofParamChanges===0) {
|
|
83
86
|
ActivateURLOnchange=true;
|
|
87
|
+
}
|
|
84
88
|
}
|
|
85
89
|
// if(ActivateURLOnchange) {
|
|
86
90
|
// const newQueryParams=await location.query();
|
|
@@ -308,12 +312,12 @@ async function handleParams(_$w,param,values) {
|
|
|
308
312
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER_ITEM_LABEL).text = itemData.label || '';
|
|
309
313
|
// Deselect this value from both the selected map and the multibox
|
|
310
314
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.DESELECT_BUTTON_ID).onClick(async () => {
|
|
311
|
-
const currentQueryParams=await location.query();
|
|
312
|
-
if(currentQueryParams.page)
|
|
313
|
-
{
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
315
|
+
// const currentQueryParams=await location.query();
|
|
316
|
+
// if(currentQueryParams.page)
|
|
317
|
+
// {
|
|
318
|
+
// //queryParams.remove(["page"]);
|
|
319
|
+
// queryParams.add({ ["page"]: 1 });
|
|
320
|
+
// }
|
|
317
321
|
const fieldId = itemData.fieldId;
|
|
318
322
|
const valueId = itemData.valueId;
|
|
319
323
|
dontUpdateThisCheckBox=fieldId;
|
|
@@ -330,11 +334,13 @@ async function handleParams(_$w,param,values) {
|
|
|
330
334
|
|
|
331
335
|
|
|
332
336
|
queryParams.add({ [fieldTitle] : updated.map(val=>encodeURIComponent(val)).join(',') });
|
|
337
|
+
numbersofParamChanges++;
|
|
333
338
|
} else {
|
|
334
339
|
selectedByField.delete(fieldId);
|
|
335
340
|
handleConsiderAllJobs(previousSelectedSize,selectedByField.size);
|
|
336
341
|
|
|
337
342
|
queryParams.remove([fieldTitle ]);
|
|
343
|
+
numbersofParamChanges++;
|
|
338
344
|
}
|
|
339
345
|
|
|
340
346
|
const currentVals = _$w(`#${FiltersIds[field.title]}CheckBox`).value || [];
|
|
@@ -438,18 +444,18 @@ async function loadJobsRepeater(_$w) {
|
|
|
438
444
|
|
|
439
445
|
_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = []; // start empty
|
|
440
446
|
_$w(`#${FiltersIds[field.title]}CheckBox`).onChange(async (ev) => {
|
|
441
|
-
const currentQueryParams=await location.query();
|
|
442
|
-
if(currentQueryParams.page)
|
|
443
|
-
{
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
447
|
+
// const currentQueryParams=await location.query();
|
|
448
|
+
// if(currentQueryParams.page)
|
|
449
|
+
// {
|
|
450
|
+
// //try instead of removing to add page = 1
|
|
451
|
+
// //queryParams.remove(["page"]);
|
|
452
|
+
// queryParams.add({ ["page"]: 1 });
|
|
453
|
+
// }
|
|
448
454
|
dontUpdateThisCheckBox=field._id;
|
|
449
455
|
const selected = ev.target.value; // array of selected value IDs
|
|
450
456
|
let fieldTitle=field.title.toLowerCase().replace(' ', '');
|
|
451
457
|
fieldTitle==="brands"? fieldTitle="brand":fieldTitle;
|
|
452
|
-
|
|
458
|
+
ActivateURLOnchange=false;
|
|
453
459
|
const previousSelectedSize=selectedByField.size;
|
|
454
460
|
|
|
455
461
|
if (selected && selected.length) {
|
|
@@ -460,15 +466,18 @@ async function loadJobsRepeater(_$w) {
|
|
|
460
466
|
//in this case we need the label not valueid
|
|
461
467
|
const valueLabels=getValueFromValueId(selected,value);
|
|
462
468
|
queryParams.add({ [fieldTitle] : valueLabels.map(val=>encodeURIComponent(val)).join(',') });
|
|
469
|
+
numbersofParamChanges++;
|
|
463
470
|
}
|
|
464
471
|
else{
|
|
465
472
|
queryParams.add({ [fieldTitle] : selected.map(val=>encodeURIComponent(val)).join(',') });
|
|
473
|
+
numbersofParamChanges++;
|
|
466
474
|
}
|
|
467
475
|
|
|
468
476
|
} else {
|
|
469
477
|
selectedByField.delete(field._id);
|
|
470
478
|
handleConsiderAllJobs(previousSelectedSize,selectedByField.size);
|
|
471
479
|
queryParams.remove([fieldTitle ]);
|
|
480
|
+
numbersofParamChanges++;
|
|
472
481
|
}
|
|
473
482
|
|
|
474
483
|
console.log("selectedByField: ",selectedByField)
|
|
@@ -680,9 +689,11 @@ function handlePageUrlParam() {
|
|
|
680
689
|
if(pagination.currentPage==1 || pagination.currentPage==0)
|
|
681
690
|
{
|
|
682
691
|
queryParams.remove(["page"]);
|
|
692
|
+
numbersofParamChanges++;
|
|
683
693
|
}
|
|
684
694
|
else{
|
|
685
695
|
queryParams.add({ ["page"]: pagination.currentPage });
|
|
696
|
+
numbersofParamChanges++;
|
|
686
697
|
}
|
|
687
698
|
}
|
|
688
699
|
async function refreshFacetCounts(_$w,clearAll=false) {
|