sr-npm 1.7.731 → 1.7.733
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
|
@@ -24,7 +24,8 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
|
24
24
|
await loadSelectedValuesRepeater(_$w);
|
|
25
25
|
await bindSearchInput(_$w);
|
|
26
26
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
|
|
27
|
-
|
|
27
|
+
console.log("clear all button clicked");
|
|
28
|
+
if(selectedByField.size>0 || _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SECONDARY_SEARCH_INPUT).value) {
|
|
28
29
|
for(const field of allfields) {
|
|
29
30
|
_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = [];
|
|
30
31
|
}
|
|
@@ -52,29 +53,21 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
52
53
|
await updateJobsAndNumbersAndFilters(_$w);
|
|
53
54
|
}
|
|
54
55
|
if(urlParams.page) {
|
|
55
|
-
console.log("urlParams.page: ", urlParams.page);
|
|
56
56
|
if(Number.isNaN(Number(urlParams.page)) || Number(urlParams.page)<=1 || Number(urlParams.page)>Math.ceil(currentJobs.length/pagination.pageSize)) {
|
|
57
|
-
console.
|
|
57
|
+
console.warn("page number is invalid, removing page from url");
|
|
58
58
|
queryParams.remove(["page"]);
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
console.log(" previous pagination.currentPage: ", pagination.currentPage);
|
|
62
61
|
pagination.currentPage=Number(urlParams.page);
|
|
63
|
-
console.log("(Number(urlParams.page)*pagination.pageSize).toString(); ", (Number(urlParams.page)*pagination.pageSize).toString());
|
|
64
62
|
let paginationCurrentText=Number(urlParams.page)*pagination.pageSize
|
|
65
63
|
let startSlicIndex=pagination.pageSize*(pagination.currentPage-1);
|
|
66
64
|
let endSlicIndex=(pagination.pageSize)*(pagination.currentPage);
|
|
67
65
|
if(Number(urlParams.page)==Math.ceil(currentJobs.length/pagination.pageSize)) {
|
|
68
|
-
console.log("last page, subtracting the remaining jobs from the pagination current text");
|
|
69
66
|
paginationCurrentText=paginationCurrentText-(pagination.pageSize-(currentJobs.length%pagination.pageSize));
|
|
70
67
|
endSlicIndex=currentJobs.length;
|
|
71
68
|
}
|
|
72
69
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = paginationCurrentText.toString();
|
|
73
|
-
console.log("pagination.currentPage: ", pagination.currentPage);
|
|
74
|
-
console.log("slicing starting from: ", startSlicIndex);
|
|
75
|
-
console.log("slicing ending at: ", endSlicIndex);
|
|
76
70
|
const jobsFirstPage=currentJobs.slice(startSlicIndex,endSlicIndex);
|
|
77
|
-
console.log("jobsFirstPage: ", jobsFirstPage);
|
|
78
71
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
|
|
79
72
|
handlePaginationButtons(_$w);
|
|
80
73
|
}
|
|
@@ -102,26 +95,16 @@ async function handleParams(_$w,param,value) {
|
|
|
102
95
|
|
|
103
96
|
async function loadPaginationButtons(_$w) {
|
|
104
97
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PAGE_BUTTON_NEXT).onClick(async () => {
|
|
105
|
-
console.log("next page button clicked");
|
|
106
|
-
console.log("current displayed jobs: ", _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data);
|
|
107
98
|
let nextPageJobs=currentJobs.slice(pagination.pageSize*pagination.currentPage,pagination.pageSize*(pagination.currentPage+1));
|
|
108
|
-
console.log("nextPageJobs ",nextPageJobs);
|
|
109
99
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = (nextPageJobs.length+pagination.pageSize*pagination.currentPage).toString();
|
|
110
|
-
console.log("current pagination.currentPage: ", pagination.currentPage);
|
|
111
100
|
pagination.currentPage++;
|
|
112
|
-
console.log("new pagination.currentPage: ", pagination.currentPage);
|
|
113
101
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = nextPageJobs;
|
|
114
102
|
handlePaginationButtons(_$w);
|
|
115
103
|
});
|
|
116
104
|
|
|
117
105
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PAGE_BUTTON_PREVIOUS).onClick(async () => {
|
|
118
|
-
console.log("previous page button clicked");
|
|
119
|
-
console.log("current displayed jobs: ", _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data);
|
|
120
106
|
let previousPageJobs=currentJobs.slice(pagination.pageSize*(pagination.currentPage-2),pagination.pageSize*(pagination.currentPage-1));
|
|
121
|
-
console.log("previousPageJobs ",previousPageJobs);
|
|
122
|
-
console.log("current pagination.currentPage: ", pagination.currentPage);
|
|
123
107
|
pagination.currentPage--;
|
|
124
|
-
console.log("new pagination.currentPage: ", pagination.currentPage);
|
|
125
108
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = (pagination.pageSize*pagination.currentPage).toString();
|
|
126
109
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = previousPageJobs;
|
|
127
110
|
handlePaginationButtons(_$w);
|