sr-npm 1.7.243 → 1.7.245

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.243",
3
+ "version": "1.7.245",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -144,7 +144,6 @@ async function handlePageParam(_$w) {
144
144
  async function bind(_$w) {
145
145
  await _$w('#jobsDataset').onReady(async () => {
146
146
  await updateCount(_$w);
147
- await updateMapMarkers(_$w);
148
147
 
149
148
  });
150
149
 
@@ -154,6 +153,9 @@ async function bind(_$w) {
154
153
 
155
154
  _$w('#positionsRepeater').onItemReady(async ($item, itemData) => {
156
155
  $item('#positionItem').onClick(() => {
156
+ console.log("itemData: ", itemData);
157
+ console.log("$item: ", $item);
158
+ console.log("itemData['link-jobs-title']: ", itemData['link-jobs-title']);
157
159
  to(`${itemData['link-jobs-title']}`);
158
160
  });
159
161
  });
@@ -176,14 +178,12 @@ function init(_$w) {
176
178
  }
177
179
 
178
180
  async function applyFilters(_$w, skipUrlUpdate = false) {
179
- console.log("applying filters");
180
181
  const dropdownFiltersMapping = [
181
182
  { elementId: '#dropdownDepartment', field: 'department', value: _$w('#dropdownDepartment').value },
182
183
  { elementId: '#dropdownLocation', field: 'cityText', value: _$w('#dropdownLocation').value },
183
184
  { elementId: '#dropdownJobType', field: 'remote', value: _$w('#dropdownJobType').value},
184
185
  { elementId: '#searchInput', field: 'title', value: _$w('#searchInput').value }
185
186
  ];
186
- console.log("dropdownFiltersMapping: ", dropdownFiltersMapping);
187
187
 
188
188
 
189
189
 
@@ -241,7 +241,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
241
241
 
242
242
  const count = await updateCount(_$w);
243
243
  console.log("updating map markers");
244
- await updateMapMarkers(_$w);
244
+ await updateMapMarkers(_$w,count);
245
245
  console.log("updating map markers completed");
246
246
  count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
247
247
 
@@ -261,13 +261,9 @@ async function resetFilters(_$w) {
261
261
 
262
262
  _$w('#resetFiltersButton').disable();
263
263
 
264
- queryParams.remove(["keyWord", "department","page","location"]);
265
-
264
+ queryParams.remove(["keyWord", "department","page"]);
266
265
 
267
266
  await updateCount(_$w);
268
- console.log("reseting map markers");
269
- await updateMapMarkers(_$w);
270
- console.log("reseting map markers completed");
271
267
  }
272
268
 
273
269
  async function updateCount(_$w) {
@@ -345,7 +341,8 @@ async function handleLocationParam(_$w,location) {
345
341
 
346
342
  }
347
343
 
348
- async function updateMapMarkers(_$w){
344
+ async function updateMapMarkers(_$w,count){
345
+ if(count>0){
349
346
  const numOfItems = await _$w('#jobsDataset').getTotalCount();
350
347
  const items = await _$w('#jobsDataset').getItems(0, numOfItems);
351
348
  const markers = items.items.map(item => {
@@ -359,13 +356,12 @@ async function updateMapMarkers(_$w){
359
356
  title: item.title,
360
357
  };
361
358
  });
362
- console.log("markers: ", markers);
363
- console.log("type of markers: ", typeof markers);
364
359
  //@ts-ignore
365
- await _$w('#googleMaps').setMarkers(markers);
366
- let getmarkers2=await _$w('#googleMaps').markers;
367
- console.log("getmarkers2: ", getmarkers2);
368
-
360
+ _$w('#googleMaps').setMarkers(markers);
361
+ }
362
+ else{
363
+ _$w('#googleMaps').setMarkers([]);
364
+ }
369
365
  }
370
366
 
371
367