sr-npm 1.7.691 → 1.7.693
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
|
@@ -18,7 +18,7 @@ const pagination = {
|
|
|
18
18
|
};
|
|
19
19
|
async function careersMultiBoxesPageOnReady(_$w) {
|
|
20
20
|
await loadData(_$w);
|
|
21
|
-
await
|
|
21
|
+
await loadJobsRepeater(_$w);
|
|
22
22
|
await loadFilters(_$w);
|
|
23
23
|
await loadSelectedValuesRepeater(_$w);
|
|
24
24
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
|
|
@@ -33,15 +33,21 @@ async function careersMultiBoxesPageOnReady(_$w) {
|
|
|
33
33
|
|
|
34
34
|
async function loadPaginationButtons(_$w) {
|
|
35
35
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PAGE_BUTTON_NEXT).onClick(async () => {
|
|
36
|
+
console.log("next page button clicked");
|
|
37
|
+
console.log("current page: ", pagination.currentPage);
|
|
36
38
|
let nextPageJobs=currentJobs.slice(pagination.pageSize*pagination.currentPage,pagination.pageSize*(pagination.currentPage+1));
|
|
37
39
|
pagination.currentPage++;
|
|
40
|
+
console.log("next page ", pagination.currentPage);
|
|
38
41
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = nextPageJobs;
|
|
39
42
|
handlePaginationButtons(_$w);
|
|
40
43
|
});
|
|
41
44
|
|
|
42
45
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PAGE_BUTTON_PREVIOUS).onClick(async () => {
|
|
46
|
+
console.log("previous page button clicked");
|
|
47
|
+
console.log("current page: ", pagination.currentPage);
|
|
43
48
|
let previousPageJobs=currentJobs.slice(pagination.pageSize*(pagination.currentPage-1),pagination.pageSize*pagination.currentPage);
|
|
44
49
|
pagination.currentPage--;
|
|
50
|
+
console.log("previous page ", pagination.currentPage);
|
|
45
51
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = previousPageJobs;
|
|
46
52
|
handlePaginationButtons(_$w);
|
|
47
53
|
});
|
|
@@ -100,7 +106,7 @@ async function loadData(_$w) {
|
|
|
100
106
|
allfields.push({_id:"Location",title:"Location"});
|
|
101
107
|
}
|
|
102
108
|
}
|
|
103
|
-
async function
|
|
109
|
+
async function loadJobsRepeater(_$w) {
|
|
104
110
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).onItemReady(($item, itemData) => {
|
|
105
111
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER_ITEM_TITLE).text = itemData.title || '';
|
|
106
112
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER_ITEM_LOCATION).text=itemData.location.fullLocation
|
|
@@ -110,6 +116,7 @@ async function loadJobs(_$w) {
|
|
|
110
116
|
const jobsFirstPage=alljobs.slice(0,pagination.pageSize);
|
|
111
117
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
|
|
112
118
|
updateTotalJobsCountText(_$w);
|
|
119
|
+
handlePaginationButtons(_$w);
|
|
113
120
|
}
|
|
114
121
|
|
|
115
122
|
function updateTotalJobsCountText(_$w) {
|
|
@@ -120,9 +127,6 @@ async function loadJobs(_$w) {
|
|
|
120
127
|
async function loadFilters(_$w) {
|
|
121
128
|
try {
|
|
122
129
|
// 1) Load all categories (fields)
|
|
123
|
-
// let fields = await getAllRecords(COLLECTIONS.CUSTOM_FIELDS);
|
|
124
|
-
|
|
125
|
-
// fields.push({_id:"Location",title:"Location"});
|
|
126
130
|
const cities=await getAllRecords(COLLECTIONS.CITIES);
|
|
127
131
|
for(const city of cities) {
|
|
128
132
|
valueToJobs[city._id]=city.jobIds;
|
|
@@ -287,6 +291,7 @@ async function loadJobs(_$w) {
|
|
|
287
291
|
currentJobs=finalFilteredJobs;
|
|
288
292
|
const jobsFirstPage=currentJobs.slice(0,pagination.pageSize);
|
|
289
293
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
|
|
294
|
+
pagination.currentPage=1;
|
|
290
295
|
handlePaginationButtons(_$w);
|
|
291
296
|
}
|
|
292
297
|
|