sr-npm 1.7.1195 → 1.7.1196

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.1195",
3
+ "version": "1.7.1196",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -43,8 +43,6 @@ const pagination = {
43
43
  };
44
44
 
45
45
  async function careersMultiBoxesPageOnReady(_$w,urlParams) {
46
- console.log("Refine search button rendered: ", _$w(CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON).rendered);
47
- console.log("Refine search button isVisible: ", _$w(CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON).isVisible);
48
46
  //to handle back and forth , url changes
49
47
  onChange(async ()=>{
50
48
  await handleBackAndForth(_$w);
@@ -56,14 +54,13 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
56
54
  loadSelectedValuesRepeater(_$w);
57
55
  bindSearchInput(_$w);
58
56
  loadPaginationButtons(_$w);
59
-
57
+ if (await window.formFactor() === "Mobile") {
58
+ handleFilterInMobile(_$w);
59
+ }
60
60
  await handleUrlParams(_$w, urlParams);
61
61
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
62
62
  await clearAll(_$w);
63
63
  });
64
- if (await window.formFactor() === "Mobile") {
65
- handleFilterInMobile(_$w);
66
- }
67
64
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_MULTI_STATE_BOX).changeState("results");
68
65
  }
69
66
 
@@ -116,26 +113,16 @@ function handleFilterInMobile(_$w) {
116
113
  CAREERS_PAGE_SELECTORS.SECTION_3,
117
114
  CAREERS_PAGE_SELECTORS.LINE_3,
118
115
  CAREERS_PAGE_SELECTORS.FILTER_ICON];
119
-
120
- const mobileFilterBoxSelectors = [
121
- CAREERS_PAGE_SELECTORS.FILTER_BOX,
122
- CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON,
123
- CAREERS_PAGE_SELECTORS.EXIT_BUTTON,
124
- ];
125
116
 
126
117
  _$w(CAREERS_PAGE_SELECTORS.FILTER_ICON).onClick(()=>{
127
- mobileFilterBoxSelectors.forEach(selector => {
128
- _$w(selector).expand();
129
- });
118
+ _$w(CAREERS_PAGE_SELECTORS.FILTER_BOX).expand();
130
119
  searchResultsSelectors.forEach(selector => {
131
120
  _$w(selector).collapse();
132
121
  });
133
122
  });
134
123
 
135
124
  const exitFilterBox = () => {
136
- mobileFilterBoxSelectors.forEach(selector => {
137
- _$w(selector).collapse();
138
- });
125
+ _$w(CAREERS_PAGE_SELECTORS.FILTER_BOX).collapse();
139
126
  searchResultsSelectors.forEach(selector => {
140
127
  _$w(selector).expand();
141
128
  });
@@ -148,11 +135,6 @@ function handleFilterInMobile(_$w) {
148
135
  _$w(CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON).onClick(()=>{
149
136
  exitFilterBox();
150
137
  });
151
-
152
- //onmobile we should collapse the filter box and the refine search button by default
153
- mobileFilterBoxSelectors.forEach(selector => {
154
- _$w(selector).collapse();
155
- });
156
138
  }
157
139
 
158
140
 
package/pages/homePage.js CHANGED
@@ -7,6 +7,7 @@ const { COLLECTIONS } = require('../backend/collectionConsts');
7
7
  const { getAllRecords } = require('./pagesUtils');
8
8
  const { handlePrimarySearch } = require('../public/primarySearchUtils');
9
9
  const { GLOBAL_SECTIONS_SELECTORS } = require('../public/selectors');
10
+ const { isElementExistOnPage } = require('psdev-utils');
10
11
 
11
12
  let thisObjectVar;
12
13
  let searchByCityFlag=false;
@@ -85,7 +86,7 @@ function bindTeamRepeater(_$w) {
85
86
 
86
87
  const $item = _$w.at(event.context);
87
88
 
88
- if(_$w("#categoriesDataset")) {
89
+ if(isElementExistOnPage(_$w("#categoriesDataset"))) {
89
90
  const clickedItemData = $item("#categoriesDataset").getCurrentItem();
90
91
  const department = encodeURIComponent(clickedItemData.title);
91
92
  location.to(`/search?category=${department}`);
@@ -10,6 +10,8 @@ const {
10
10
  } = require('../public/utils');
11
11
 
12
12
 
13
+
14
+
13
15
  async function positionPageOnReady(_$w) {
14
16
  console.log("positionPageOnReady called");
15
17
  await bind(_$w);
@@ -88,14 +90,8 @@ async function getCategoryValue(customValues) {
88
90
  }
89
91
 
90
92
  function handleReferFriendButton(_$w,item) {
91
- if(isElementExistOnPage(_$w('#referFriendButton'))){
92
- if(!item.referFriendLink){
93
- _$w('#referFriendButton').hide();
94
- }
95
- else {
96
- _$w('#referFriendButton').target="_blank";
97
- _$w('#referFriendButton').link=item.referFriendLink;
98
- }
93
+ if(!item.referFriendLink && isElementExistOnPage(_$w('#referFriendButton'))){
94
+ _$w('#referFriendButton').hide();
99
95
  }
100
96
  }
101
97
 
@@ -153,5 +153,4 @@ return count > 0;
153
153
 
154
154
  module.exports = {
155
155
  handlePrimarySearch,
156
- queryPrimarySearchResults
157
156
  }