sr-npm 1.7.727 → 1.7.729
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
|
@@ -58,18 +58,18 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
58
58
|
queryParams.remove(["page"]);
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
console.log(" previous pagination.currentPage: ", pagination.currentPage);
|
|
62
|
+
pagination.currentPage=Number(urlParams.page);
|
|
62
63
|
console.log("(Number(urlParams.page)*pagination.pageSize).toString(); ", (Number(urlParams.page)*pagination.pageSize).toString());
|
|
63
64
|
let paginationCurrentText=Number(urlParams.page)*pagination.pageSize
|
|
64
65
|
let startSlicIndex=pagination.pageSize*(pagination.currentPage-1);
|
|
65
|
-
let endSlicIndex=(pagination.pageSize)*(pagination.currentPage)
|
|
66
|
+
let endSlicIndex=(pagination.pageSize)*(pagination.currentPage);
|
|
66
67
|
if(Number(urlParams.page)==Math.ceil(currentJobs.length/pagination.pageSize)) {
|
|
67
68
|
console.log("last page, subtracting the remaining jobs from the pagination current text");
|
|
68
|
-
paginationCurrentText=paginationCurrentText-(currentJobs.length%pagination.pageSize);
|
|
69
|
+
paginationCurrentText=paginationCurrentText-(pagination.pageSize-(currentJobs.length%pagination.pageSize));
|
|
69
70
|
endSlicIndex=currentJobs.length;
|
|
70
71
|
}
|
|
71
72
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = paginationCurrentText.toString();
|
|
72
|
-
pagination.currentPage=Number(urlParams.page);
|
|
73
73
|
console.log("pagination.currentPage: ", pagination.currentPage);
|
|
74
74
|
console.log("slicing starting from: ", startSlicIndex);
|
|
75
75
|
console.log("slicing ending at: ", endSlicIndex);
|
|
@@ -102,16 +102,26 @@ async function handleParams(_$w,param,value) {
|
|
|
102
102
|
|
|
103
103
|
async function loadPaginationButtons(_$w) {
|
|
104
104
|
_$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);
|
|
105
107
|
let nextPageJobs=currentJobs.slice(pagination.pageSize*pagination.currentPage,pagination.pageSize*(pagination.currentPage+1));
|
|
108
|
+
console.log("nextPageJobs ",nextPageJobs);
|
|
106
109
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = (nextPageJobs.length+pagination.pageSize*pagination.currentPage).toString();
|
|
110
|
+
console.log("current pagination.currentPage: ", pagination.currentPage);
|
|
107
111
|
pagination.currentPage++;
|
|
112
|
+
console.log("new pagination.currentPage: ", pagination.currentPage);
|
|
108
113
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = nextPageJobs;
|
|
109
114
|
handlePaginationButtons(_$w);
|
|
110
115
|
});
|
|
111
116
|
|
|
112
117
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PAGE_BUTTON_PREVIOUS).onClick(async () => {
|
|
113
|
-
|
|
118
|
+
console.log("previous page button clicked");
|
|
119
|
+
console.log("current displayed jobs: ", _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data);
|
|
120
|
+
let previousPageJobs=currentJobs.slice(pagination.pageSize*(pagination.currentPage-2),pagination.pageSize*pagination.currentPage);
|
|
121
|
+
console.log("previousPageJobs ",previousPageJobs);
|
|
122
|
+
console.log("current pagination.currentPage: ", pagination.currentPage);
|
|
114
123
|
pagination.currentPage--;
|
|
124
|
+
console.log("new pagination.currentPage: ", pagination.currentPage);
|
|
115
125
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = (pagination.pageSize*pagination.currentPage).toString();
|
|
116
126
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = previousPageJobs;
|
|
117
127
|
handlePaginationButtons(_$w);
|