sr-npm 1.7.232 → 1.7.233

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.232",
3
+ "version": "1.7.233",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,7 +17,6 @@ const {
17
17
  let queryKeyWordVar;
18
18
  let queryDepartmentVar;
19
19
  let queryLocationVar;
20
- let searchInputFocused = false;
21
20
  async function careersPageOnReady(_$w,thisObject,queryParams) {
22
21
  console.log("queryParams: ", queryParams);
23
22
  const { page, keyWord, department, location } = queryParams;
@@ -145,6 +144,7 @@ async function handlePageParam(_$w) {
145
144
  async function bind(_$w) {
146
145
  await _$w('#jobsDataset').onReady(async () => {
147
146
  await updateCount(_$w);
147
+ await updateMapMarkers(_$w);
148
148
 
149
149
  });
150
150
 
@@ -163,8 +163,6 @@ function init(_$w) {
163
163
  const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
164
164
 
165
165
  _$w('#searchInput').onInput(debouncedSearch);
166
- _$w('#searchInput').onFocus(() => { searchInputFocused = true; });
167
- _$w('#searchInput').onBlur(() => { searchInputFocused = false; });
168
166
  _$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>applyFilters(_$w));
169
167
  _$w('#resetFiltersButton, #clearSearch').onClick(()=>resetFilters(_$w));
170
168
 
@@ -178,7 +176,6 @@ function init(_$w) {
178
176
  }
179
177
 
180
178
  async function applyFilters(_$w, skipUrlUpdate = false) {
181
-
182
179
  const dropdownFiltersMapping = [
183
180
  { elementId: '#dropdownDepartment', field: 'department', value: _$w('#dropdownDepartment').value },
184
181
  { elementId: '#dropdownLocation', field: 'cityText', value: _$w('#dropdownLocation').value },
@@ -240,16 +237,9 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
240
237
  await _$w('#jobsDataset').setFilter(filter);
241
238
  await _$w('#jobsDataset').refresh();
242
239
 
243
-
244
- if (searchInputFocused) {
245
- console.log("focusing search input");
246
- _$w('#searchInput').focus();
247
-
248
- }
249
-
250
240
  const count = await updateCount(_$w);
251
241
  console.log("updating map markers");
252
- await updateMapMarkers(_$w,count);
242
+ await updateMapMarkers(_$w);
253
243
  console.log("updating map markers completed");
254
244
  count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
255
245
 
@@ -269,9 +259,13 @@ async function resetFilters(_$w) {
269
259
 
270
260
  _$w('#resetFiltersButton').disable();
271
261
 
272
- queryParams.remove(["keyWord", "department","page"]);
262
+ queryParams.remove(["keyWord", "department","page","location"]);
263
+
273
264
 
274
265
  await updateCount(_$w);
266
+ console.log("reseting map markers");
267
+ await updateMapMarkers(_$w);
268
+ console.log("reseting map markers completed");
275
269
  }
276
270
 
277
271
  async function updateCount(_$w) {
@@ -349,14 +343,13 @@ async function handleLocationParam(_$w,location) {
349
343
 
350
344
  }
351
345
 
352
- async function updateMapMarkers(_$w,count){
353
- if(count>0){
346
+ async function updateMapMarkers(_$w){
354
347
  const numOfItems = await _$w('#jobsDataset').getTotalCount();
348
+ // if(numOfItems>0){
355
349
  const items = await _$w('#jobsDataset').getItems(0, numOfItems);
356
350
  const markers = items.items.map(item => {
357
351
  const location = item.locationAddress.location;
358
352
  return {
359
-
360
353
  location: {
361
354
  latitude: location.latitude,
362
355
  longitude: location.longitude
@@ -365,12 +358,13 @@ async function updateMapMarkers(_$w,count){
365
358
  title: item.title,
366
359
  };
367
360
  });
361
+ console.log("markers: ", markers);
362
+ console.log("type of markers: ", typeof markers);
368
363
  //@ts-ignore
369
364
  _$w('#googleMaps').setMarkers(markers);
370
- }
371
- else{
372
- _$w('#googleMaps').setMarkers([]);
373
- }
365
+ let getmarkers2=await _$w('#googleMaps').markers;
366
+ console.log("getmarkers2: ", getmarkers2);
367
+
374
368
  }
375
369
 
376
370