sr-npm 1.7.344 → 1.7.346
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 +63 -50
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -32,7 +32,7 @@ thisObjectVar=thisObject;
|
|
|
32
32
|
allJobs=await getAllPositions();
|
|
33
33
|
await activateAutoLoad(_$w);
|
|
34
34
|
await bind(_$w);
|
|
35
|
-
await init(_$w);
|
|
35
|
+
await init(_$w,thisObject,queryParams);
|
|
36
36
|
await handleUrlParams(_$w);
|
|
37
37
|
|
|
38
38
|
}
|
|
@@ -160,7 +160,7 @@ async function bind(_$w) {
|
|
|
160
160
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
function init(_$w) {
|
|
163
|
+
function init(_$w,thisObject,queryParams) {
|
|
164
164
|
const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
|
|
165
165
|
_$w('#searchInput').onInput(debouncedSearch);
|
|
166
166
|
_$w('#searchInput').onBlur(()=>{
|
|
@@ -183,46 +183,57 @@ function init(_$w) {
|
|
|
183
183
|
|
|
184
184
|
//URL onChange
|
|
185
185
|
onChange(async ()=>{
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
console.log("location.query(): ", newQueryParams);
|
|
189
|
-
if(newQueryParams.keyWord){
|
|
190
|
-
console.log("setting querykeyparam")
|
|
191
|
-
queryKeyWordVar=newQueryParams.keyWord;
|
|
192
|
-
}
|
|
193
|
-
else
|
|
194
|
-
{
|
|
195
|
-
queryKeyWordVar=undefined;
|
|
196
|
-
_$w('#searchInput').value = '';
|
|
197
|
-
deletedParam=true;
|
|
198
|
-
}
|
|
199
|
-
if(newQueryParams.department){
|
|
200
|
-
console.log("setting queryDepartmentVar")
|
|
201
|
-
queryDepartmentVar=newQueryParams.department;
|
|
202
|
-
}
|
|
203
|
-
else
|
|
204
|
-
{
|
|
205
|
-
queryDepartmentVar=undefined;
|
|
206
|
-
_$w('#dropdownDepartment').value = '';
|
|
207
|
-
deletedParam=true;
|
|
208
|
-
}
|
|
209
|
-
if(newQueryParams.location){
|
|
210
|
-
console.log("setting queryLocationVar")
|
|
211
|
-
queryLocationVar=newQueryParams.location;
|
|
212
|
-
}
|
|
213
|
-
else
|
|
214
|
-
{
|
|
215
|
-
queryLocationVar=undefined;
|
|
216
|
-
_$w('#dropdownLocation').value = '';
|
|
217
|
-
deletedParam=true;
|
|
218
|
-
}
|
|
186
|
+
console.log("onChange triggering on ready");
|
|
187
|
+
await careersPageOnReady(_$w,thisObject,queryParams);
|
|
219
188
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
189
|
+
|
|
190
|
+
//try onready first
|
|
191
|
+
//try location to
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
// handleBackAndForth(_$w);
|
|
198
|
+
// const newQueryParams=await location.query();
|
|
199
|
+
// console.log("location.query(): ", newQueryParams);
|
|
200
|
+
// if(newQueryParams.keyWord){
|
|
201
|
+
// console.log("setting querykeyparam")
|
|
202
|
+
// queryKeyWordVar=newQueryParams.keyWord;
|
|
203
|
+
// }
|
|
204
|
+
// else
|
|
205
|
+
// {
|
|
206
|
+
// queryKeyWordVar=undefined;
|
|
207
|
+
// _$w('#searchInput').value = '';
|
|
208
|
+
// deletedParam=true;
|
|
209
|
+
// }
|
|
210
|
+
// if(newQueryParams.department){
|
|
211
|
+
// console.log("setting queryDepartmentVar")
|
|
212
|
+
// queryDepartmentVar=newQueryParams.department;
|
|
213
|
+
// }
|
|
214
|
+
// else
|
|
215
|
+
// {
|
|
216
|
+
// queryDepartmentVar=undefined;
|
|
217
|
+
// _$w('#dropdownDepartment').value = '';
|
|
218
|
+
// deletedParam=true;
|
|
219
|
+
// }
|
|
220
|
+
// if(newQueryParams.location){
|
|
221
|
+
// console.log("setting queryLocationVar")
|
|
222
|
+
// queryLocationVar=newQueryParams.location;
|
|
223
|
+
// }
|
|
224
|
+
// else
|
|
225
|
+
// {
|
|
226
|
+
// queryLocationVar=undefined;
|
|
227
|
+
// _$w('#dropdownLocation').value = '';
|
|
228
|
+
// deletedParam=true;
|
|
229
|
+
// }
|
|
230
|
+
|
|
231
|
+
// await handleUrlParams(_$w);
|
|
232
|
+
// if(deletedParam)
|
|
233
|
+
// {
|
|
234
|
+
// await applyFilters(_$w,true);
|
|
235
|
+
// deletedParam=false;
|
|
236
|
+
// }
|
|
226
237
|
});
|
|
227
238
|
|
|
228
239
|
|
|
@@ -253,9 +264,9 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
253
264
|
filter.value = '';
|
|
254
265
|
if (!skipUrlUpdate) {
|
|
255
266
|
queryParams.remove(["keyWord", "department","page","location"]);
|
|
256
|
-
queryKeyWordVar=undefined;
|
|
257
|
-
queryDepartmentVar=undefined;
|
|
258
|
-
queryLocationVar=undefined;
|
|
267
|
+
// queryKeyWordVar=undefined;
|
|
268
|
+
// queryDepartmentVar=undefined;
|
|
269
|
+
// queryLocationVar=undefined;
|
|
259
270
|
}
|
|
260
271
|
}
|
|
261
272
|
|
|
@@ -264,15 +275,15 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
264
275
|
if (!skipUrlUpdate) {
|
|
265
276
|
if(filter.field === 'title'){
|
|
266
277
|
queryParams.add({ keyWord: filter.value });
|
|
267
|
-
|
|
278
|
+
// queryKeyWordVar=filter.value;
|
|
268
279
|
}
|
|
269
280
|
if(filter.field === 'department'){
|
|
270
281
|
queryParams.add({ department: encodeURIComponent(filter.value) });
|
|
271
|
-
queryDepartmentVar=filter.value;
|
|
282
|
+
//queryDepartmentVar=filter.value;
|
|
272
283
|
}
|
|
273
284
|
if(filter.field === 'cityText'){
|
|
274
285
|
queryParams.add({ location: encodeURIComponent(filter.value) });
|
|
275
|
-
queryLocationVar=filter.value;
|
|
286
|
+
//queryLocationVar=filter.value;
|
|
276
287
|
}
|
|
277
288
|
}
|
|
278
289
|
if(filter.field === 'remote') {
|
|
@@ -286,15 +297,17 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
286
297
|
if (!skipUrlUpdate) {
|
|
287
298
|
if(filter.field === 'title'){
|
|
288
299
|
queryParams.remove(["keyWord" ]);
|
|
289
|
-
|
|
300
|
+
// queryKeyWordVar=undefined;
|
|
290
301
|
}
|
|
291
302
|
if(filter.field === 'department'){
|
|
303
|
+
console.log("removing department from url")
|
|
292
304
|
queryParams.remove(["department" ]);
|
|
293
|
-
|
|
305
|
+
// queryDepartmentVar=undefined;
|
|
294
306
|
}
|
|
295
307
|
if(filter.field === 'cityText'){
|
|
308
|
+
console.log("removing location from url")
|
|
296
309
|
queryParams.remove(["location" ]);
|
|
297
|
-
|
|
310
|
+
// queryLocationVar=undefined;
|
|
298
311
|
}
|
|
299
312
|
}
|
|
300
313
|
}
|