sr-npm 1.7.231 → 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 +1 -1
- package/pages/careersPage.js +14 -18
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -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,14 +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
|
-
_$w('#searchInput').focus();
|
|
246
|
-
}
|
|
247
|
-
|
|
248
240
|
const count = await updateCount(_$w);
|
|
249
241
|
console.log("updating map markers");
|
|
250
|
-
await updateMapMarkers(_$w
|
|
242
|
+
await updateMapMarkers(_$w);
|
|
251
243
|
console.log("updating map markers completed");
|
|
252
244
|
count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
|
|
253
245
|
|
|
@@ -267,9 +259,13 @@ async function resetFilters(_$w) {
|
|
|
267
259
|
|
|
268
260
|
_$w('#resetFiltersButton').disable();
|
|
269
261
|
|
|
270
|
-
queryParams.remove(["keyWord", "department","page"]);
|
|
262
|
+
queryParams.remove(["keyWord", "department","page","location"]);
|
|
263
|
+
|
|
271
264
|
|
|
272
265
|
await updateCount(_$w);
|
|
266
|
+
console.log("reseting map markers");
|
|
267
|
+
await updateMapMarkers(_$w);
|
|
268
|
+
console.log("reseting map markers completed");
|
|
273
269
|
}
|
|
274
270
|
|
|
275
271
|
async function updateCount(_$w) {
|
|
@@ -347,14 +343,13 @@ async function handleLocationParam(_$w,location) {
|
|
|
347
343
|
|
|
348
344
|
}
|
|
349
345
|
|
|
350
|
-
async function updateMapMarkers(_$w
|
|
351
|
-
if(count>0){
|
|
346
|
+
async function updateMapMarkers(_$w){
|
|
352
347
|
const numOfItems = await _$w('#jobsDataset').getTotalCount();
|
|
348
|
+
// if(numOfItems>0){
|
|
353
349
|
const items = await _$w('#jobsDataset').getItems(0, numOfItems);
|
|
354
350
|
const markers = items.items.map(item => {
|
|
355
351
|
const location = item.locationAddress.location;
|
|
356
352
|
return {
|
|
357
|
-
|
|
358
353
|
location: {
|
|
359
354
|
latitude: location.latitude,
|
|
360
355
|
longitude: location.longitude
|
|
@@ -363,12 +358,13 @@ async function updateMapMarkers(_$w,count){
|
|
|
363
358
|
title: item.title,
|
|
364
359
|
};
|
|
365
360
|
});
|
|
361
|
+
console.log("markers: ", markers);
|
|
362
|
+
console.log("type of markers: ", typeof markers);
|
|
366
363
|
//@ts-ignore
|
|
367
364
|
_$w('#googleMaps').setMarkers(markers);
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
365
|
+
let getmarkers2=await _$w('#googleMaps').markers;
|
|
366
|
+
console.log("getmarkers2: ", getmarkers2);
|
|
367
|
+
|
|
372
368
|
}
|
|
373
369
|
|
|
374
370
|
|