sr-npm 1.7.1297 → 1.7.1299
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,5 +1,5 @@
|
|
|
1
1
|
const { COLLECTIONS,CUSTOM_VALUES_COLLECTION_FIELDS,JOBS_COLLECTION_FIELDS } = require('../backend/collectionConsts');
|
|
2
|
-
const { CAREERS_PAGE_SELECTORS, GLOBAL_SECTIONS_SELECTORS } = require('../public/selectors');
|
|
2
|
+
const { CAREERS_PAGE_SELECTORS, GLOBAL_SECTIONS_SELECTORS, SEARCH_RESULTS_SELECTORS, MOBILE_FILTER_BOX_SELECTORS } = require('../public/selectors');
|
|
3
3
|
|
|
4
4
|
const { window } = require('@wix/site-window');
|
|
5
5
|
const { queryParams,onChange} = require('wix-location-frontend');
|
|
@@ -39,7 +39,6 @@ let secondarySearchIsFilled=false // whether the secondary search is filled with
|
|
|
39
39
|
let keywordAllJobs; // all jobs that are displayed in the jobs repeater when the keyword is filled
|
|
40
40
|
let ActivateURLOnchange=true; // whether to activate the url onchange
|
|
41
41
|
let considerAllJobs=false; // whether to consider all jobs or not
|
|
42
|
-
let formFactor;
|
|
43
42
|
const pagination = {
|
|
44
43
|
pageSize: 10,
|
|
45
44
|
currentPage: 1,
|
|
@@ -62,15 +61,13 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
|
62
61
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
|
|
63
62
|
await clearAll(_$w);
|
|
64
63
|
});
|
|
65
|
-
|
|
64
|
+
|
|
65
|
+
handleFilterButton(_$w);
|
|
66
|
+
|
|
66
67
|
setInterval(async () => {
|
|
67
68
|
const windowinfo=await window.getBoundingRect();
|
|
68
69
|
if(windowinfo.window.width>1000){
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
else{
|
|
72
|
-
|
|
73
|
-
handleFilterButton(_$w,formFactor);
|
|
70
|
+
handleWindowResize(_$w);
|
|
74
71
|
}
|
|
75
72
|
}, 600);
|
|
76
73
|
|
|
@@ -81,6 +78,18 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
|
81
78
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_MULTI_STATE_BOX).changeState("results");
|
|
82
79
|
}
|
|
83
80
|
|
|
81
|
+
async function handleWindowResize(_$w) {
|
|
82
|
+
MOBILE_FILTER_BOX_SELECTORS.forEach(selector => {
|
|
83
|
+
_$w(selector).expand();
|
|
84
|
+
});
|
|
85
|
+
SEARCH_RESULTS_SELECTORS.forEach(selector => {
|
|
86
|
+
_$w(selector).expand();
|
|
87
|
+
});
|
|
88
|
+
_$w(CAREERS_PAGE_SELECTORS.FILTER_ICON).collapse();
|
|
89
|
+
_$w(CAREERS_PAGE_SELECTORS.EXIT_BUTTON).collapse();
|
|
90
|
+
_$w(CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON).collapse();
|
|
91
|
+
|
|
92
|
+
}
|
|
84
93
|
async function handleBackAndForth(_$w){
|
|
85
94
|
if(ActivateURLOnchange) {
|
|
86
95
|
await clearAll(_$w);
|
|
@@ -125,39 +134,24 @@ async function clearAll(_$w,urlOnChange=false) {
|
|
|
125
134
|
|
|
126
135
|
}
|
|
127
136
|
|
|
128
|
-
function handleFilterButton(_$w
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
CAREERS_PAGE_SELECTORS.RESULT_BOX,
|
|
132
|
-
CAREERS_PAGE_SELECTORS.PAGINATION_BTN,
|
|
133
|
-
CAREERS_PAGE_SELECTORS.HEAD_BTNS,
|
|
134
|
-
CAREERS_PAGE_SELECTORS.SELECTED_VALUES_REPEATER,
|
|
135
|
-
CAREERS_PAGE_SELECTORS.BUTTOM_TXT,
|
|
136
|
-
CAREERS_PAGE_SELECTORS.SECTION_24,
|
|
137
|
-
CAREERS_PAGE_SELECTORS.SECTION_3,
|
|
138
|
-
CAREERS_PAGE_SELECTORS.LINE_3,
|
|
139
|
-
CAREERS_PAGE_SELECTORS.FILTER_ICON];
|
|
140
|
-
|
|
141
|
-
const mobileFilterBoxSelectors = [
|
|
142
|
-
CAREERS_PAGE_SELECTORS.FILTER_BOX,
|
|
143
|
-
CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON,
|
|
144
|
-
CAREERS_PAGE_SELECTORS.EXIT_BUTTON,
|
|
145
|
-
];
|
|
137
|
+
async function handleFilterButton(_$w) {
|
|
138
|
+
|
|
139
|
+
|
|
146
140
|
|
|
147
141
|
_$w(CAREERS_PAGE_SELECTORS.FILTER_ICON).onClick(()=>{
|
|
148
|
-
|
|
142
|
+
MOBILE_FILTER_BOX_SELECTORS.forEach(selector => {
|
|
149
143
|
_$w(selector).expand();
|
|
150
144
|
});
|
|
151
|
-
|
|
145
|
+
SEARCH_RESULTS_SELECTORS.forEach(selector => {
|
|
152
146
|
_$w(selector).collapse();
|
|
153
147
|
});
|
|
154
148
|
});
|
|
155
149
|
|
|
156
150
|
const exitFilterBox = () => {
|
|
157
|
-
|
|
151
|
+
MOBILE_FILTER_BOX_SELECTORS.forEach(selector => {
|
|
158
152
|
_$w(selector).collapse();
|
|
159
153
|
});
|
|
160
|
-
|
|
154
|
+
SEARCH_RESULTS_SELECTORS.forEach(selector => {
|
|
161
155
|
_$w(selector).expand();
|
|
162
156
|
});
|
|
163
157
|
}
|
|
@@ -171,22 +165,13 @@ function handleFilterButton(_$w,formFactor) {
|
|
|
171
165
|
});
|
|
172
166
|
|
|
173
167
|
//onmobile we should collapse the filter box and the refine search button by default
|
|
168
|
+
const formFactor = await window.formFactor();
|
|
174
169
|
if(formFactor === "Mobile" || formFactor === "Tablet") {
|
|
175
|
-
|
|
170
|
+
MOBILE_FILTER_BOX_SELECTORS.forEach(selector => {
|
|
176
171
|
_$w(selector).collapse();
|
|
177
172
|
});
|
|
178
173
|
}
|
|
179
|
-
|
|
180
|
-
mobileFilterBoxSelectors.forEach(selector => {
|
|
181
|
-
_$w(selector).expand();
|
|
182
|
-
});
|
|
183
|
-
searchResultsSelectors.forEach(selector => {
|
|
184
|
-
_$w(selector).expand();
|
|
185
|
-
});
|
|
186
|
-
_$w(CAREERS_PAGE_SELECTORS.FILTER_ICON).collapse();
|
|
187
|
-
_$w(CAREERS_PAGE_SELECTORS.EXIT_BUTTON).collapse();
|
|
188
|
-
_$w(CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON).collapse();
|
|
189
|
-
}
|
|
174
|
+
|
|
190
175
|
}
|
|
191
176
|
|
|
192
177
|
|
package/public/selectors.js
CHANGED
|
@@ -50,8 +50,27 @@ const FILTER_FIELDS = {
|
|
|
50
50
|
SEARCH: 'title',
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
|
|
54
|
+
const SEARCH_RESULTS_SELECTORS = [
|
|
55
|
+
CAREERS_PAGE_SELECTORS.RESULT_BOX,
|
|
56
|
+
CAREERS_PAGE_SELECTORS.PAGINATION_BTN,
|
|
57
|
+
CAREERS_PAGE_SELECTORS.HEAD_BTNS,
|
|
58
|
+
CAREERS_PAGE_SELECTORS.SELECTED_VALUES_REPEATER,
|
|
59
|
+
CAREERS_PAGE_SELECTORS.BUTTOM_TXT,
|
|
60
|
+
CAREERS_PAGE_SELECTORS.SECTION_24,
|
|
61
|
+
CAREERS_PAGE_SELECTORS.SECTION_3,
|
|
62
|
+
CAREERS_PAGE_SELECTORS.LINE_3,
|
|
63
|
+
CAREERS_PAGE_SELECTORS.FILTER_ICON];
|
|
64
|
+
|
|
65
|
+
const MOBILE_FILTER_BOX_SELECTORS = [
|
|
66
|
+
CAREERS_PAGE_SELECTORS.FILTER_BOX,
|
|
67
|
+
CAREERS_PAGE_SELECTORS.REFINE_SEARCH_BUTTON,
|
|
68
|
+
CAREERS_PAGE_SELECTORS.EXIT_BUTTON,
|
|
69
|
+
];
|
|
53
70
|
module.exports = {
|
|
54
71
|
CAREERS_PAGE_SELECTORS,
|
|
55
72
|
GLOBAL_SECTIONS_SELECTORS,
|
|
56
73
|
FILTER_FIELDS,
|
|
74
|
+
SEARCH_RESULTS_SELECTORS,
|
|
75
|
+
MOBILE_FILTER_BOX_SELECTORS,
|
|
57
76
|
}
|