sr-npm 3.1.19 → 3.1.22
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
|
@@ -54,13 +54,14 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
|
54
54
|
loadSelectedValuesRepeater(_$w);
|
|
55
55
|
bindSearchInput(_$w);
|
|
56
56
|
loadPaginationButtons(_$w);
|
|
57
|
-
|
|
58
|
-
handleFilterInMobile(_$w);
|
|
59
|
-
}
|
|
57
|
+
|
|
60
58
|
await handleUrlParams(_$w, urlParams);
|
|
61
59
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
|
|
62
60
|
await clearAll(_$w);
|
|
63
61
|
});
|
|
62
|
+
if (await window.formFactor() === "Mobile") {
|
|
63
|
+
handleFilterInMobile(_$w);
|
|
64
|
+
}
|
|
64
65
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_MULTI_STATE_BOX).changeState("results");
|
|
65
66
|
}
|
|
66
67
|
|
|
@@ -113,16 +114,26 @@ function handleFilterInMobile(_$w) {
|
|
|
113
114
|
CAREERS_PAGE_SELECTORS.SECTION_3,
|
|
114
115
|
CAREERS_PAGE_SELECTORS.LINE_3,
|
|
115
116
|
CAREERS_PAGE_SELECTORS.FILTER_ICON];
|
|
117
|
+
|
|
118
|
+
const mobileFilterBoxSelectors = [
|
|
119
|
+
CAREERS_PAGE_SELECTORS.FILTER_BOX,
|
|
120
|
+
CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON,
|
|
121
|
+
CAREERS_PAGE_SELECTORS.EXIT_BUTTON,
|
|
122
|
+
];
|
|
116
123
|
|
|
117
124
|
_$w(CAREERS_PAGE_SELECTORS.FILTER_ICON).onClick(()=>{
|
|
118
|
-
|
|
125
|
+
mobileFilterBoxSelectors.forEach(selector => {
|
|
126
|
+
_$w(selector).expand();
|
|
127
|
+
});
|
|
119
128
|
searchResultsSelectors.forEach(selector => {
|
|
120
129
|
_$w(selector).collapse();
|
|
121
130
|
});
|
|
122
131
|
});
|
|
123
132
|
|
|
124
133
|
const exitFilterBox = () => {
|
|
125
|
-
|
|
134
|
+
mobileFilterBoxSelectors.forEach(selector => {
|
|
135
|
+
_$w(selector).collapse();
|
|
136
|
+
});
|
|
126
137
|
searchResultsSelectors.forEach(selector => {
|
|
127
138
|
_$w(selector).expand();
|
|
128
139
|
});
|
|
@@ -135,6 +146,11 @@ function handleFilterInMobile(_$w) {
|
|
|
135
146
|
_$w(CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON).onClick(()=>{
|
|
136
147
|
exitFilterBox();
|
|
137
148
|
});
|
|
149
|
+
|
|
150
|
+
//onmobile we should collapse the filter box and the refine search button by default
|
|
151
|
+
mobileFilterBoxSelectors.forEach(selector => {
|
|
152
|
+
_$w(selector).collapse();
|
|
153
|
+
});
|
|
138
154
|
}
|
|
139
155
|
|
|
140
156
|
|
package/pages/careersPage.js
CHANGED
|
@@ -192,18 +192,18 @@ function init(_$w) {
|
|
|
192
192
|
searchInputBlurredFirstTime=false;
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
|
-
_$w(CAREERS_PAGE_SELECTORS.DROPDOWN_DEPARTMENT, CAREERS_PAGE_SELECTORS.DROPDOWN_LOCATION, CAREERS_PAGE_SELECTORS.DROPDOWN_JOB_TYPE, CAREERS_PAGE_SELECTORS.DROPDOWN_BRAND).onChange(()=>{
|
|
195
|
+
_$w(CAREERS_PAGE_SELECTORS.DROPDOWN_DEPARTMENT+', '+ CAREERS_PAGE_SELECTORS.DROPDOWN_LOCATION+', '+ CAREERS_PAGE_SELECTORS.DROPDOWN_JOB_TYPE+', '+ CAREERS_PAGE_SELECTORS.DROPDOWN_BRAND).onChange(()=>{
|
|
196
196
|
console.log("dropdown onChange is triggered");
|
|
197
197
|
applyFilters(_$w);
|
|
198
198
|
});
|
|
199
|
-
_$w(CAREERS_PAGE_SELECTORS.RESET_FILTERS_BUTTON, CAREERS_PAGE_SELECTORS.CLEAR_SEARCH).onClick(()=>resetFilters(_$w));
|
|
199
|
+
_$w(CAREERS_PAGE_SELECTORS.RESET_FILTERS_BUTTON+', '+ CAREERS_PAGE_SELECTORS.CLEAR_SEARCH).onClick(()=>resetFilters(_$w));
|
|
200
200
|
|
|
201
201
|
_$w(CAREERS_PAGE_SELECTORS.OPEN_FILTERS_BUTTON).onClick(()=>{
|
|
202
|
-
_$w(CAREERS_PAGE_SELECTORS.DROPDOWN_CONTAINER, CAREERS_PAGE_SELECTORS.CLOSE_FILTERS_BUTTON).expand();
|
|
202
|
+
_$w(CAREERS_PAGE_SELECTORS.DROPDOWN_CONTAINER+', '+ CAREERS_PAGE_SELECTORS.CLOSE_FILTERS_BUTTON).expand();
|
|
203
203
|
});
|
|
204
204
|
|
|
205
205
|
_$w(CAREERS_PAGE_SELECTORS.CLOSE_FILTERS_BUTTON).onClick(()=>{
|
|
206
|
-
_$w(CAREERS_PAGE_SELECTORS.DROPDOWN_CONTAINER, CAREERS_PAGE_SELECTORS.CLOSE_FILTERS_BUTTON).collapse();
|
|
206
|
+
_$w(CAREERS_PAGE_SELECTORS.DROPDOWN_CONTAINER+', '+ CAREERS_PAGE_SELECTORS.CLOSE_FILTERS_BUTTON).collapse();
|
|
207
207
|
});
|
|
208
208
|
|
|
209
209
|
//URL onChange
|
|
@@ -355,7 +355,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
async function resetFilters(_$w) {
|
|
358
|
-
_$w(CAREERS_PAGE_SELECTORS.SEARCH_INPUT, CAREERS_PAGE_SELECTORS.DROPDOWN_DEPARTMENT, CAREERS_PAGE_SELECTORS.DROPDOWN_LOCATION, CAREERS_PAGE_SELECTORS.DROPDOWN_JOB_TYPE, CAREERS_PAGE_SELECTORS.DROPDOWN_BRAND).value = '';
|
|
358
|
+
_$w(CAREERS_PAGE_SELECTORS.SEARCH_INPUT+', '+ CAREERS_PAGE_SELECTORS.DROPDOWN_DEPARTMENT+', '+ CAREERS_PAGE_SELECTORS.DROPDOWN_LOCATION+', '+ CAREERS_PAGE_SELECTORS.DROPDOWN_JOB_TYPE+', '+ CAREERS_PAGE_SELECTORS.DROPDOWN_BRAND).value = '';
|
|
359
359
|
|
|
360
360
|
await _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).setFilter(wixData.filter());
|
|
361
361
|
await _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).refresh();
|
|
@@ -404,8 +404,7 @@ async function handleDepartmentParam(_$w,department) {
|
|
|
404
404
|
queryParams.remove(["department" ]);
|
|
405
405
|
|
|
406
406
|
}
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
|
|
409
408
|
|
|
410
409
|
}
|
|
411
410
|
|
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;
|
|
@@ -65,35 +66,22 @@ function bind(_$w) {
|
|
|
65
66
|
function bindTeamRepeater(_$w) {
|
|
66
67
|
_$w('#teamRepeater').onItemReady(($item, itemData) => {
|
|
67
68
|
$item('#teamButton').label = `View ${itemData.count} Open Positions`;
|
|
68
|
-
// const department = encodeURIComponent(itemData.title);
|
|
69
|
-
// if (itemData.customField) {
|
|
70
|
-
// [$item('#teamButton'), $item('#teamButton2')].forEach(btn => {
|
|
71
|
-
// btn.onClick(() => {
|
|
72
|
-
// location.to(`/search?category=${department}`);
|
|
73
|
-
// });
|
|
74
|
-
// });
|
|
75
|
-
|
|
76
|
-
// }
|
|
77
|
-
// else{
|
|
78
|
-
// $item('#teamButton').onClick(()=>{
|
|
79
|
-
// location.to(`/positions?department=${department}`);
|
|
80
|
-
// });
|
|
81
|
-
// }
|
|
82
69
|
});
|
|
83
70
|
|
|
84
71
|
_$w("#teamRepeaterItem").onClick((event) => {
|
|
85
72
|
|
|
86
73
|
const $item = _$w.at(event.context);
|
|
87
74
|
|
|
88
|
-
if(_$w("#categoriesDataset")) {
|
|
75
|
+
if(isElementExistOnPage(_$w("#categoriesDataset"))) {
|
|
89
76
|
const clickedItemData = $item("#categoriesDataset").getCurrentItem();
|
|
90
77
|
const department = encodeURIComponent(clickedItemData.title);
|
|
91
78
|
location.to(`/search?category=${department}`);
|
|
92
79
|
}
|
|
93
80
|
else
|
|
94
81
|
{
|
|
95
|
-
|
|
96
|
-
|
|
82
|
+
const clickedItemData = $item("#dataset1").getCurrentItem()
|
|
83
|
+
const department = encodeURIComponent(clickedItemData.title);
|
|
84
|
+
location.to(`/positions?department=${department}`);
|
|
97
85
|
}
|
|
98
86
|
});
|
|
99
87
|
|
package/pages/positionPage.js
CHANGED
|
@@ -10,8 +10,6 @@ const {
|
|
|
10
10
|
} = require('../public/utils');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
13
|
async function positionPageOnReady(_$w) {
|
|
16
14
|
console.log("positionPageOnReady called");
|
|
17
15
|
await bind(_$w);
|
|
@@ -90,8 +88,14 @@ async function getCategoryValue(customValues) {
|
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
function handleReferFriendButton(_$w,item) {
|
|
93
|
-
if(
|
|
94
|
-
|
|
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
|
+
}
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
|