sr-npm 1.7.87 → 1.7.89

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.87",
3
+ "version": "1.7.89",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -76,7 +76,7 @@ async function handleUrlParams(_$w) {
76
76
  await handleKeyWordParam(_$w,query.keyWord);
77
77
  }
78
78
  if (query.page) {
79
- await handlePageParam(_$w,query.page);
79
+ await handlePageParam(_$w);
80
80
 
81
81
  }
82
82
  }
@@ -88,22 +88,22 @@ async function handleKeyWordParam(_$w,keyWord) {
88
88
  await _$w("#jobsDataset").refresh();
89
89
  }
90
90
 
91
- async function handlePageParam(_$w,page) {
91
+ async function handlePageParam(_$w) {
92
92
 
93
- if(allJobs.length/itemsPerPage<page){
93
+ if(allJobs.length/itemsPerPage<query.page){
94
94
  console.log(`max page is: ${allJobs.length/itemsPerPage}`)
95
95
  queryParams.add({ page: allJobs.length/itemsPerPage })
96
96
  }
97
- if(page<=1){
97
+ if(query.page<=1){
98
98
  console.log("min page is : 2")
99
99
  pageParamSet=2;
100
100
  queryParams.add({ page: 2 })
101
101
  }
102
- if (page) {
103
- pageParamSet=page;
102
+ if (query.page) {
103
+ pageParamSet=query.page;
104
104
  //scrolls a bit to load the dataset data
105
105
  await window.scrollTo(0, 200,{scrollAnimation:false});
106
- for (let i = 2; i <= page; i++) {
106
+ for (let i = 2; i <= query.page; i++) {
107
107
  await _$w("#jobsDataset").loadMore();
108
108
  currentLoadedItems=currentLoadedItems+itemsPerPage
109
109
  }
@@ -199,7 +199,7 @@ async function applyFilters(_$w) {
199
199
  await _$w('#jobsDataset').setFilter(filter);
200
200
  await _$w('#jobsDataset').refresh();
201
201
 
202
- const count = await updateCount();
202
+ const count = await updateCount(_$w);
203
203
 
204
204
  count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
205
205
 
package/pages/homePage.js CHANGED
@@ -4,8 +4,9 @@ const {
4
4
  } = require('../public/filterUtils');
5
5
  const { handleOnLocationClick } = require('../public/mapUtils');
6
6
  const { location } = require('@wix/site-location');
7
-
8
- async function homePageOnReady(_$w) {
7
+ let thisObjectVar;
8
+ async function homePageOnReady(_$w,thisObject) {
9
+ thisObjectVar=thisObject;
9
10
  await bind(_$w);
10
11
  await init(_$w);
11
12
  }
@@ -38,7 +39,7 @@ async function homePageOnReady(_$w) {
38
39
  }
39
40
 
40
41
  function init(_$w) {
41
- const debouncedInput = debounce(handleSearchInput, 400);
42
+ const debouncedInput = debounce(()=>handleSearchInput(_$w), 400,thisObjectVar);
42
43
 
43
44
  _$w('#searchInput').onInput(debouncedInput);
44
45
  _$w('#searchInput').maxLength = 40;