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