sr-npm 1.7.899 → 1.7.900
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
|
@@ -16,6 +16,7 @@ let currentJobs=[] // current jobs that are displayed in the jobs repeater
|
|
|
16
16
|
let allsecondarySearchJobs=[] // secondary search results that are displayed in the jobs repeater
|
|
17
17
|
let currentSecondarySearchJobs=[] // current secondary search results that are displayed in the jobs repeater
|
|
18
18
|
let secondarySearchIsFilled=false // whether the secondary search is filled with results
|
|
19
|
+
let keywordAllJobs=[] // all jobs that are displayed in the jobs repeater when the keyword is filled
|
|
19
20
|
const pagination = {
|
|
20
21
|
pageSize: 10,
|
|
21
22
|
currentPage: 1,
|
|
@@ -48,6 +49,7 @@ async function clearAll(_$w) {
|
|
|
48
49
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).value='';
|
|
49
50
|
secondarySearchIsFilled=false;
|
|
50
51
|
currentJobs=alljobs;
|
|
52
|
+
keywordAllJobs=alljobs;
|
|
51
53
|
await updateJobsAndNumbersAndFilters(_$w,true);
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -62,7 +64,8 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
62
64
|
applyFiltering=await primarySearch(_$w, decodeURIComponent(urlParams.keyword), alljobs);
|
|
63
65
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).value=decodeURIComponent(urlParams.keyword);
|
|
64
66
|
keyword=true;
|
|
65
|
-
currentJobs=_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER).data;
|
|
67
|
+
currentJobs=_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER).data;
|
|
68
|
+
keywordAllJobs=_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER).data;
|
|
66
69
|
}
|
|
67
70
|
if(urlParams.brand) {
|
|
68
71
|
applyFiltering=await handleParams(_$w,"brand",urlParams.brand)
|
|
@@ -75,7 +78,7 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
if(applyFiltering || keyword) {
|
|
78
|
-
await updateJobsAndNumbersAndFilters(_$w,false);
|
|
81
|
+
await updateJobsAndNumbersAndFilters(_$w,false,keyword);
|
|
79
82
|
}
|
|
80
83
|
if(urlParams.page) {
|
|
81
84
|
if(Number.isNaN(Number(urlParams.page)) || Number(urlParams.page)<=1 || Number(urlParams.page)>Math.ceil(currentJobs.length/pagination.pageSize)) {
|
|
@@ -287,8 +290,8 @@ async function loadJobsRepeater(_$w) {
|
|
|
287
290
|
|
|
288
291
|
|
|
289
292
|
|
|
290
|
-
async function updateJobsAndNumbersAndFilters(_$w,clearAll=false) {
|
|
291
|
-
await applyJobFilters(_$w); // re-query jobs
|
|
293
|
+
async function updateJobsAndNumbersAndFilters(_$w,clearAll=false,keyword=false) {
|
|
294
|
+
await applyJobFilters(_$w,keyword); // re-query jobs
|
|
292
295
|
await refreshFacetCounts(_$w,clearAll); // recompute and update counts in all lists
|
|
293
296
|
await updateSelectedValuesRepeater(_$w);
|
|
294
297
|
updateTotalJobsCountText(_$w);
|
|
@@ -333,13 +336,13 @@ async function loadJobsRepeater(_$w) {
|
|
|
333
336
|
_$w(`#${FiltersIds[fieldTitle]}CheckBox`).value = preserved;
|
|
334
337
|
}
|
|
335
338
|
|
|
336
|
-
async function applyJobFilters(_$w) {
|
|
339
|
+
async function applyJobFilters(_$w,keyword=false) {
|
|
337
340
|
let tempFilteredJobs=[];
|
|
338
341
|
let finalFilteredJobs=[];
|
|
339
|
-
secondarySearchIsFilled? finalFilteredJobs=allsecondarySearchJobs:finalFilteredJobs=
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
342
|
+
secondarySearchIsFilled? finalFilteredJobs=allsecondarySearchJobs:finalFilteredJobs=alljobs;
|
|
343
|
+
if(keyword) {
|
|
344
|
+
finalFilteredJobs=keywordAllJobs
|
|
345
|
+
}
|
|
343
346
|
let addedJobsIds=new Set();
|
|
344
347
|
// AND across categories, OR within each category
|
|
345
348
|
for (const [key, values] of selectedByField.entries()) {
|