sr-npm 1.2.57 → 1.2.58

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.2.57",
3
+ "version": "1.2.58",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,7 +20,7 @@ const { groupValuesByField,
20
20
  getOptionIndexFromCheckBox,
21
21
  getAllDatasetItems
22
22
  } = require('./pagesUtils');
23
- const { loadPrimarySearchRepeater, bindPrimarySearch, primarySearch } = require('../public/primarySearchUtil');
23
+ const { handlePrimarySearch, primarySearch } = require('../public/primarySearchUtils');
24
24
 
25
25
 
26
26
  let dontUpdateThisCheckBox;
@@ -50,7 +50,7 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
50
50
 
51
51
  await loadData(_$w);
52
52
  await loadJobsRepeater(_$w); // if we remove the await here the job list will be flaky , it doesn't fill it properly
53
- loadPrimarySearchRepeater(_$w);
53
+ handlePrimarySearch(_$w, allvaluesobjects);
54
54
  await loadFilters(_$w);
55
55
  loadSelectedValuesRepeater(_$w);
56
56
  bindSearchInput(_$w);
@@ -641,8 +641,6 @@ async function secondarySearch(_$w,query) {
641
641
  }
642
642
  function bindSearchInput(_$w) {
643
643
  try {
644
- bindPrimarySearch(_$w, allvaluesobjects);
645
-
646
644
  const secondarySearchDebounced = debounce(async () => {
647
645
  const query = (_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SECONDARY_SEARCH_INPUT).value || '').toLowerCase().trim();
648
646
  await secondarySearch(_$w, query);
package/pages/homePage.js CHANGED
@@ -5,7 +5,7 @@ const { location } = require('@wix/site-location');
5
5
  const {wixData} = require('wix-data');
6
6
  const { COLLECTIONS } = require('../backend/collectionConsts');
7
7
  const { getAllRecords } = require('./pagesUtils');
8
- const { bindPrimarySearch, loadPrimarySearchRepeater } = require('../public/primarySearchUtil');
8
+ const { handlePrimarySearch } = require('../public/primarySearchUtils');
9
9
 
10
10
  let thisObjectVar;
11
11
  let searchByCityFlag=false;
@@ -18,8 +18,7 @@ async function homePageOnReady(_$w,thisObject = null) {
18
18
 
19
19
  if(siteconfig.twg) {
20
20
  const allvaluesobjects = await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
21
- bindPrimarySearch(_$w, allvaluesobjects);
22
- loadPrimarySearchRepeater(_$w)
21
+ handlePrimarySearch(_$w, allvaluesobjects);
23
22
  console.log("siteconfig.twg: ",siteconfig.twg);
24
23
 
25
24
  if(siteconfig.twg === "external") {
@@ -3,6 +3,11 @@ const { location } = require("@wix/site-location");
3
3
  const { getFilter } = require('../public/filterUtils');
4
4
  const { debounce } = require('./utils');
5
5
 
6
+ async function handlePrimarySearch(_$w, allvaluesobjects) {
7
+ loadPrimarySearchRepeater(_$w);
8
+ bindPrimarySearch(_$w, allvaluesobjects);
9
+ }
10
+
6
11
  function loadPrimarySearchRepeater(_$w) {
7
12
 
8
13
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER_ITEM).onClick((event) => {
@@ -151,4 +156,5 @@ module.exports = {
151
156
  loadPrimarySearchRepeater,
152
157
  bindPrimarySearch,
153
158
  primarySearch,
159
+ handlePrimarySearch,
154
160
  }