sr-npm 1.7.347 → 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.347",
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,10 +185,31 @@ function init(_$w,thisObject,queryParams) {
183
185
 
184
186
  //URL onChange
185
187
  onChange(async ()=>{
188
+ let deletedParam=false
186
189
  const newQueryParams=await location.query();
187
190
  console.log("onChange triggering on ready");
188
191
  console.log("newQueryParams: ", newQueryParams);
189
- location.to(`/positions?KeyWord=123}`);
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
+
190
213
 
191
214
 
192
215
 
@@ -379,7 +402,7 @@ async function handleDepartmentParam(_$w,department) {
379
402
  {
380
403
  console.log("department value found in dropdown options ",departmentValue);
381
404
  _$w('#dropdownDepartment').value = departmentValue;
382
- 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
383
406
  }
384
407
  else{
385
408
  console.warn("department value not found in dropdown options");
@@ -420,7 +443,7 @@ async function handleLocationParam(_$w,location) {
420
443
 
421
444
  if(option){
422
445
  _$w('#dropdownLocation').value = option.value;
423
- 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
424
447
  }
425
448
  else{
426
449
  console.warn("location value not found in dropdown options");