sr-npm 1.7.690 → 1.7.692
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,23 @@ 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;
|
|
42
|
+
handlePaginationButtons(_$w);
|
|
39
43
|
});
|
|
40
44
|
|
|
41
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);
|
|
42
48
|
let previousPageJobs=currentJobs.slice(pagination.pageSize*(pagination.currentPage-1),pagination.pageSize*pagination.currentPage);
|
|
43
49
|
pagination.currentPage--;
|
|
50
|
+
console.log("previous page ", pagination.currentPage);
|
|
44
51
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = previousPageJobs;
|
|
52
|
+
handlePaginationButtons(_$w);
|
|
45
53
|
});
|
|
46
54
|
}
|
|
47
55
|
|
|
@@ -98,7 +106,7 @@ async function loadData(_$w) {
|
|
|
98
106
|
allfields.push({_id:"Location",title:"Location"});
|
|
99
107
|
}
|
|
100
108
|
}
|
|
101
|
-
async function
|
|
109
|
+
async function loadJobsRepeater(_$w) {
|
|
102
110
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).onItemReady(($item, itemData) => {
|
|
103
111
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER_ITEM_TITLE).text = itemData.title || '';
|
|
104
112
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER_ITEM_LOCATION).text=itemData.location.fullLocation
|
|
@@ -108,6 +116,7 @@ async function loadJobs(_$w) {
|
|
|
108
116
|
const jobsFirstPage=alljobs.slice(0,pagination.pageSize);
|
|
109
117
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
|
|
110
118
|
updateTotalJobsCountText(_$w);
|
|
119
|
+
handlePaginationButtons(_$w);
|
|
111
120
|
}
|
|
112
121
|
|
|
113
122
|
function updateTotalJobsCountText(_$w) {
|
|
@@ -118,9 +127,6 @@ async function loadJobs(_$w) {
|
|
|
118
127
|
async function loadFilters(_$w) {
|
|
119
128
|
try {
|
|
120
129
|
// 1) Load all categories (fields)
|
|
121
|
-
// let fields = await getAllRecords(COLLECTIONS.CUSTOM_FIELDS);
|
|
122
|
-
|
|
123
|
-
// fields.push({_id:"Location",title:"Location"});
|
|
124
130
|
const cities=await getAllRecords(COLLECTIONS.CITIES);
|
|
125
131
|
for(const city of cities) {
|
|
126
132
|
valueToJobs[city._id]=city.jobIds;
|