sr-npm 1.7.321 → 1.7.323
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 +1 -1
- package/pages/careersPage.js +20 -17
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const { getAllPositions } = require('../backend/queries');
|
|
2
2
|
const {wixData} = require('wix-data');
|
|
3
3
|
const { window } = require('@wix/site-window');
|
|
4
|
-
const { query,queryParams
|
|
4
|
+
//const { query,queryParams} = require("wix-location-frontend");
|
|
5
|
+
const {wixLocationFrontend} = require("wix-location-frontend");
|
|
5
6
|
const {
|
|
6
7
|
debounce,
|
|
7
8
|
getFilter,
|
|
@@ -54,7 +55,7 @@ async function loadMoreJobs(_$w) {
|
|
|
54
55
|
let shouldLoad = false;
|
|
55
56
|
if (pageParamSet == 0) {
|
|
56
57
|
shouldLoad = true;
|
|
57
|
-
} else if (query.page % 2 == pageParamSet % 2) {
|
|
58
|
+
} else if (wixLocationFrontend.query.page % 2 == pageParamSet % 2) {
|
|
58
59
|
shouldLoad = true;
|
|
59
60
|
} else {
|
|
60
61
|
pageParamSet = Number(pageParamSet) + 1;
|
|
@@ -107,12 +108,12 @@ async function handlePageParam(_$w) {
|
|
|
107
108
|
|
|
108
109
|
if(allJobs.length/itemsPerPage<queryPageVar){
|
|
109
110
|
console.log(`max page is: ${allJobs.length/itemsPerPage}`)
|
|
110
|
-
queryParams.add({ page: allJobs.length/itemsPerPage })
|
|
111
|
+
wixLocationFrontend.queryParams.add({ page: allJobs.length/itemsPerPage })
|
|
111
112
|
}
|
|
112
113
|
if(queryPageVar<=1){
|
|
113
114
|
console.log("min page is : 2")
|
|
114
115
|
pageParamSet=2;
|
|
115
|
-
queryParams.add({ page: 2 })
|
|
116
|
+
wixLocationFrontend.queryParams.add({ page: 2 })
|
|
116
117
|
}
|
|
117
118
|
if (queryPageVar) {
|
|
118
119
|
pageParamSet=queryPageVar;
|
|
@@ -173,12 +174,14 @@ function init(_$w) {
|
|
|
173
174
|
_$w('#closeFiltersButton').onClick(()=>{
|
|
174
175
|
_$w('#dropdownsContainer, #closeFiltersButton').collapse();
|
|
175
176
|
});
|
|
176
|
-
|
|
177
|
-
wixLocationFrontend.onChange(()=>{
|
|
178
|
-
console.log("
|
|
177
|
+
|
|
178
|
+
wixLocationFrontend.onChange((location)=>{
|
|
179
|
+
console.log("onChange#@!@!@#@#@!#",location);
|
|
179
180
|
});
|
|
180
181
|
|
|
181
182
|
|
|
183
|
+
|
|
184
|
+
|
|
182
185
|
}
|
|
183
186
|
|
|
184
187
|
|
|
@@ -203,7 +206,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
203
206
|
_$w(filter.elementId).value = '';
|
|
204
207
|
filter.value = '';
|
|
205
208
|
if (!skipUrlUpdate) {
|
|
206
|
-
queryParams.remove(["keyWord", "department","page","location"]);
|
|
209
|
+
wixLocationFrontend.queryParams.remove(["keyWord", "department","page","location"]);
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
|
|
@@ -211,13 +214,13 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
211
214
|
if (filter.value && filter.value.trim() !== '') {
|
|
212
215
|
if (!skipUrlUpdate) {
|
|
213
216
|
if(filter.field === 'title'){
|
|
214
|
-
queryParams.add({ keyWord: filter.value });
|
|
217
|
+
wixLocationFrontend.queryParams.add({ keyWord: filter.value });
|
|
215
218
|
}
|
|
216
219
|
if(filter.field === 'department'){
|
|
217
|
-
queryParams.add({ department: encodeURIComponent(filter.value) });
|
|
220
|
+
wixLocationFrontend.queryParams.add({ department: encodeURIComponent(filter.value) });
|
|
218
221
|
}
|
|
219
222
|
if(filter.field === 'cityText'){
|
|
220
|
-
queryParams.add({ location: encodeURIComponent(filter.value) });
|
|
223
|
+
wixLocationFrontend.queryParams.add({ location: encodeURIComponent(filter.value) });
|
|
221
224
|
}
|
|
222
225
|
}
|
|
223
226
|
if(filter.field === 'remote') {
|
|
@@ -230,13 +233,13 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
230
233
|
else{
|
|
231
234
|
if (!skipUrlUpdate) {
|
|
232
235
|
if(filter.field === 'title'){
|
|
233
|
-
queryParams.remove(["keyWord" ]);
|
|
236
|
+
wixLocationFrontend.queryParams.remove(["keyWord" ]);
|
|
234
237
|
}
|
|
235
238
|
if(filter.field === 'department'){
|
|
236
|
-
queryParams.remove(["department" ]);
|
|
239
|
+
wixLocationFrontend.queryParams.remove(["department" ]);
|
|
237
240
|
}
|
|
238
241
|
if(filter.field === 'cityText'){
|
|
239
|
-
queryParams.remove(["location" ]);
|
|
242
|
+
wixLocationFrontend.queryParams.remove(["location" ]);
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
245
|
}
|
|
@@ -270,7 +273,7 @@ async function resetFilters(_$w) {
|
|
|
270
273
|
|
|
271
274
|
_$w('#resetFiltersButton').disable();
|
|
272
275
|
|
|
273
|
-
queryParams.remove(["keyWord", "department","page","location"]);
|
|
276
|
+
wixLocationFrontend.queryParams.remove(["keyWord", "department","page","location"]);
|
|
274
277
|
|
|
275
278
|
|
|
276
279
|
await updateCount(_$w);
|
|
@@ -307,7 +310,7 @@ async function handleDepartmentParam(_$w,department) {
|
|
|
307
310
|
}
|
|
308
311
|
else{
|
|
309
312
|
console.warn("department value not found in dropdown options");
|
|
310
|
-
queryParams.remove(["department" ]);
|
|
313
|
+
wixLocationFrontend.queryParams.remove(["department" ]);
|
|
311
314
|
|
|
312
315
|
}
|
|
313
316
|
|
|
@@ -348,7 +351,7 @@ async function handleLocationParam(_$w,location) {
|
|
|
348
351
|
}
|
|
349
352
|
else{
|
|
350
353
|
console.warn("location value not found in dropdown options");
|
|
351
|
-
queryParams.remove(["location"]);
|
|
354
|
+
wixLocationFrontend.queryParams.remove(["location"]);
|
|
352
355
|
}
|
|
353
356
|
|
|
354
357
|
}
|