sr-npm 1.7.233 → 1.7.234
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 +13 -15
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -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
|
|
|
@@ -159,7 +158,7 @@ async function bind(_$w) {
|
|
|
159
158
|
});
|
|
160
159
|
}
|
|
161
160
|
|
|
162
|
-
function init(_$w) {
|
|
161
|
+
async function init(_$w) {
|
|
163
162
|
const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
|
|
164
163
|
|
|
165
164
|
_$w('#searchInput').onInput(debouncedSearch);
|
|
@@ -173,6 +172,10 @@ function init(_$w) {
|
|
|
173
172
|
_$w('#closeFiltersButton').onClick(()=>{
|
|
174
173
|
_$w('#dropdownsContainer, #closeFiltersButton').collapse();
|
|
175
174
|
});
|
|
175
|
+
|
|
176
|
+
if (await window.formFactor === "Mobile") {
|
|
177
|
+
_$w('#closeFiltersButton').expand();
|
|
178
|
+
}
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
@@ -239,7 +242,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
239
242
|
|
|
240
243
|
const count = await updateCount(_$w);
|
|
241
244
|
console.log("updating map markers");
|
|
242
|
-
await updateMapMarkers(_$w);
|
|
245
|
+
await updateMapMarkers(_$w,count);
|
|
243
246
|
console.log("updating map markers completed");
|
|
244
247
|
count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
|
|
245
248
|
|
|
@@ -259,13 +262,9 @@ async function resetFilters(_$w) {
|
|
|
259
262
|
|
|
260
263
|
_$w('#resetFiltersButton').disable();
|
|
261
264
|
|
|
262
|
-
queryParams.remove(["keyWord", "department","page"
|
|
263
|
-
|
|
265
|
+
queryParams.remove(["keyWord", "department","page"]);
|
|
264
266
|
|
|
265
267
|
await updateCount(_$w);
|
|
266
|
-
console.log("reseting map markers");
|
|
267
|
-
await updateMapMarkers(_$w);
|
|
268
|
-
console.log("reseting map markers completed");
|
|
269
268
|
}
|
|
270
269
|
|
|
271
270
|
async function updateCount(_$w) {
|
|
@@ -343,9 +342,9 @@ async function handleLocationParam(_$w,location) {
|
|
|
343
342
|
|
|
344
343
|
}
|
|
345
344
|
|
|
346
|
-
async function updateMapMarkers(_$w){
|
|
345
|
+
async function updateMapMarkers(_$w,count){
|
|
346
|
+
if(count>0){
|
|
347
347
|
const numOfItems = await _$w('#jobsDataset').getTotalCount();
|
|
348
|
-
// if(numOfItems>0){
|
|
349
348
|
const items = await _$w('#jobsDataset').getItems(0, numOfItems);
|
|
350
349
|
const markers = items.items.map(item => {
|
|
351
350
|
const location = item.locationAddress.location;
|
|
@@ -358,13 +357,12 @@ async function updateMapMarkers(_$w){
|
|
|
358
357
|
title: item.title,
|
|
359
358
|
};
|
|
360
359
|
});
|
|
361
|
-
console.log("markers: ", markers);
|
|
362
|
-
console.log("type of markers: ", typeof markers);
|
|
363
360
|
//@ts-ignore
|
|
364
361
|
_$w('#googleMaps').setMarkers(markers);
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
362
|
+
}
|
|
363
|
+
else{
|
|
364
|
+
_$w('#googleMaps').setMarkers([]);
|
|
365
|
+
}
|
|
368
366
|
}
|
|
369
367
|
|
|
370
368
|
|