sr-npm 1.7.322 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.322",
3
+ "version": "1.7.323",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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,onChange} = require("wix-location-frontend");
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;
@@ -174,8 +175,8 @@ function init(_$w) {
174
175
  _$w('#dropdownsContainer, #closeFiltersButton').collapse();
175
176
  });
176
177
 
177
- onChange(()=>{
178
- console.log("onChange");
178
+ wixLocationFrontend.onChange((location)=>{
179
+ console.log("onChange#@!@!@#@#@!#",location);
179
180
  });
180
181
 
181
182
 
@@ -205,7 +206,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
205
206
  _$w(filter.elementId).value = '';
206
207
  filter.value = '';
207
208
  if (!skipUrlUpdate) {
208
- queryParams.remove(["keyWord", "department","page","location"]);
209
+ wixLocationFrontend.queryParams.remove(["keyWord", "department","page","location"]);
209
210
  }
210
211
  }
211
212
 
@@ -213,13 +214,13 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
213
214
  if (filter.value && filter.value.trim() !== '') {
214
215
  if (!skipUrlUpdate) {
215
216
  if(filter.field === 'title'){
216
- queryParams.add({ keyWord: filter.value });
217
+ wixLocationFrontend.queryParams.add({ keyWord: filter.value });
217
218
  }
218
219
  if(filter.field === 'department'){
219
- queryParams.add({ department: encodeURIComponent(filter.value) });
220
+ wixLocationFrontend.queryParams.add({ department: encodeURIComponent(filter.value) });
220
221
  }
221
222
  if(filter.field === 'cityText'){
222
- queryParams.add({ location: encodeURIComponent(filter.value) });
223
+ wixLocationFrontend.queryParams.add({ location: encodeURIComponent(filter.value) });
223
224
  }
224
225
  }
225
226
  if(filter.field === 'remote') {
@@ -232,13 +233,13 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
232
233
  else{
233
234
  if (!skipUrlUpdate) {
234
235
  if(filter.field === 'title'){
235
- queryParams.remove(["keyWord" ]);
236
+ wixLocationFrontend.queryParams.remove(["keyWord" ]);
236
237
  }
237
238
  if(filter.field === 'department'){
238
- queryParams.remove(["department" ]);
239
+ wixLocationFrontend.queryParams.remove(["department" ]);
239
240
  }
240
241
  if(filter.field === 'cityText'){
241
- queryParams.remove(["location" ]);
242
+ wixLocationFrontend.queryParams.remove(["location" ]);
242
243
  }
243
244
  }
244
245
  }
@@ -272,7 +273,7 @@ async function resetFilters(_$w) {
272
273
 
273
274
  _$w('#resetFiltersButton').disable();
274
275
 
275
- queryParams.remove(["keyWord", "department","page","location"]);
276
+ wixLocationFrontend.queryParams.remove(["keyWord", "department","page","location"]);
276
277
 
277
278
 
278
279
  await updateCount(_$w);
@@ -309,7 +310,7 @@ async function handleDepartmentParam(_$w,department) {
309
310
  }
310
311
  else{
311
312
  console.warn("department value not found in dropdown options");
312
- queryParams.remove(["department" ]);
313
+ wixLocationFrontend.queryParams.remove(["department" ]);
313
314
 
314
315
  }
315
316
 
@@ -350,7 +351,7 @@ async function handleLocationParam(_$w,location) {
350
351
  }
351
352
  else{
352
353
  console.warn("location value not found in dropdown options");
353
- queryParams.remove(["location"]);
354
+ wixLocationFrontend.queryParams.remove(["location"]);
354
355
  }
355
356
 
356
357
  }