sr-npm 1.7.277 → 1.7.279

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.277",
3
+ "version": "1.7.279",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,7 +18,7 @@ const {
18
18
  let queryKeyWordVar;
19
19
  let queryDepartmentVar;
20
20
  let queryLocationVar;
21
- let searchInputIsUsed=false;
21
+ let searchInputBlurredFirstTime=true;
22
22
  async function careersPageOnReady(_$w,thisObject,queryParams) {
23
23
  console.log("queryParams: ", queryParams);
24
24
  const { page, keyWord, department, location } = queryParams;
@@ -161,14 +161,16 @@ async function bind(_$w) {
161
161
  }
162
162
 
163
163
  function init(_$w) {
164
- const debouncedSearch = debounce(()=>
165
- {
166
- applyFilters(_$w);
167
- _$w('#searchInput').focus();
168
- }, 400,thisObjectVar);
164
+ const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
169
165
  _$w('#searchInput').onInput(debouncedSearch);
170
- _$w('#searchInput').onFocus(()=>searchInputIsUsed=true);
171
- _$w('#searchInput').onBlur(()=>searchInputIsUsed=false);
166
+ _$w('#searchInput').onBlur(()=>{
167
+ if(searchInputBlurredFirstTime)
168
+ {
169
+ console.log("search input blurred");
170
+ _$w('#searchInput').focus();
171
+ searchInputBlurredFirstTime=false;
172
+ }
173
+ });
172
174
  _$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>applyFilters(_$w));
173
175
  _$w('#resetFiltersButton, #clearSearch').onClick(()=>resetFilters(_$w));
174
176
 
@@ -182,15 +184,6 @@ function init(_$w) {
182
184
 
183
185
  }
184
186
 
185
- function onchangeSearchInput(_$w){
186
- const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
187
- debouncedSearch();
188
- _$w('#searchInput').focus();
189
-
190
-
191
- console.log("onchangeSearchInput");
192
- searchInputIsUsed=true;
193
- }
194
187
 
195
188
  async function applyFilters(_$w, skipUrlUpdate = false) {
196
189
  console.log("applying filters");
@@ -266,11 +259,6 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
266
259
  // Update reset button state
267
260
  const hasActiveFilters = filters.length > 0;
268
261
  hasActiveFilters? _$w('#resetFiltersButton').enable() : _$w('#resetFiltersButton').disable();
269
- if(searchInputIsUsed){
270
- console.log("focusing search input");
271
- _$w('#searchInput').focus();
272
- console.log("search input focused");
273
- }
274
262
 
275
263
 
276
264
  }