sr-npm 1.7.346 → 1.7.348

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.346",
3
+ "version": "1.7.348",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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,thisObject,queryParams);
35
+ await init(_$w);
36
36
  await handleUrlParams(_$w);
37
37
 
38
38
  }
@@ -102,12 +102,14 @@ async function handleUrlParams(_$w) {
102
102
  if (queryLocationVar) {
103
103
  await handleLocationParam(_$w,queryLocationVar);
104
104
  }
105
+
106
+ await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
105
107
  }
106
108
 
107
109
  async function handleKeyWordParam(_$w,keyWord) {
108
110
  _$w('#searchInput').value = keyWord;
109
111
  // Use applyFilters to maintain consistency instead of directly setting filter
110
- await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
112
+ // await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
111
113
  }
112
114
 
113
115
  async function handlePageParam(_$w) {
@@ -160,7 +162,7 @@ async function bind(_$w) {
160
162
 
161
163
  }
162
164
 
163
- function init(_$w,thisObject,queryParams) {
165
+ function init(_$w) {
164
166
  const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
165
167
  _$w('#searchInput').onInput(debouncedSearch);
166
168
  _$w('#searchInput').onBlur(()=>{
@@ -183,8 +185,33 @@ function init(_$w,thisObject,queryParams) {
183
185
 
184
186
  //URL onChange
185
187
  onChange(async ()=>{
188
+ let deletedParam=false
189
+ const newQueryParams=await location.query();
186
190
  console.log("onChange triggering on ready");
187
- await careersPageOnReady(_$w,thisObject,queryParams);
191
+ console.log("newQueryParams: ", newQueryParams);
192
+ if(newQueryParams.department){
193
+ queryDepartmentVar=newQueryParams.department;
194
+ }
195
+ else{
196
+ queryDepartmentVar=undefined;
197
+ deletedParam=true;
198
+ _$w('#dropdownDepartment').value = '';
199
+ }
200
+ if(newQueryParams.location){
201
+ queryLocationVar=newQueryParams.location;
202
+ }
203
+ else{
204
+ queryLocationVar=undefined;
205
+ deletedParam=true
206
+ _$w('#dropdownLocation').value = '';
207
+ }
208
+ await handleUrlParams(_$w);
209
+ // if(deletedParam){
210
+ // await applyFilters(_$w,true);
211
+ // }
212
+
213
+
214
+
188
215
 
189
216
 
190
217
  //try onready first
@@ -375,7 +402,7 @@ async function handleDepartmentParam(_$w,department) {
375
402
  {
376
403
  console.log("department value found in dropdown options ",departmentValue);
377
404
  _$w('#dropdownDepartment').value = departmentValue;
378
- await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
405
+ // await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
379
406
  }
380
407
  else{
381
408
  console.warn("department value not found in dropdown options");
@@ -416,7 +443,7 @@ async function handleLocationParam(_$w,location) {
416
443
 
417
444
  if(option){
418
445
  _$w('#dropdownLocation').value = option.value;
419
- await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
446
+ // await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
420
447
  }
421
448
  else{
422
449
  console.warn("location value not found in dropdown options");