sr-npm 1.7.1283 → 1.7.1285
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,7 +1,7 @@
|
|
|
1
1
|
const { COLLECTIONS,CUSTOM_VALUES_COLLECTION_FIELDS,JOBS_COLLECTION_FIELDS } = require('../backend/collectionConsts');
|
|
2
2
|
const { CAREERS_PAGE_SELECTORS, GLOBAL_SECTIONS_SELECTORS } = require('../public/selectors');
|
|
3
3
|
|
|
4
|
-
const { window } = require('@wix/site-window');
|
|
4
|
+
const { window:wixWindow } = require('@wix/site-window');
|
|
5
5
|
const { queryParams,onChange} = require('wix-location-frontend');
|
|
6
6
|
const { location } = require("@wix/site-location");
|
|
7
7
|
const {
|
|
@@ -41,7 +41,6 @@ let ActivateURLOnchange=true; // whether to activate the url onchange
|
|
|
41
41
|
let considerAllJobs=false; // whether to consider all jobs or not
|
|
42
42
|
let urlOnchangeIsActive=false
|
|
43
43
|
let numbersofParamChanges=0;
|
|
44
|
-
let pageIsRemoved=false
|
|
45
44
|
let selectedParamsList=[]
|
|
46
45
|
let urlParamsIndex=0;
|
|
47
46
|
const pagination = {
|
|
@@ -53,65 +52,6 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
|
53
52
|
//to handle back and forth , url changes
|
|
54
53
|
selectedParamsList.push(urlParams);
|
|
55
54
|
onChange(async ()=>{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// INSERT_YOUR_CODE
|
|
59
|
-
|
|
60
|
-
// Yes, you can try to identify if it was a browser backward or forward navigation by using the window 'popstate' event and maintaining a stack/history index.
|
|
61
|
-
// Here's a simple approach using a navigation index:
|
|
62
|
-
if (typeof window !== "undefined") {
|
|
63
|
-
if (!window._careersNavIndex) {
|
|
64
|
-
window._careersNavIndex = 0;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
let navDirection = null;
|
|
68
|
-
|
|
69
|
-
window.addEventListener('popstate', function (event) {
|
|
70
|
-
// Get new history state index, fallback to custom counter if unavailable
|
|
71
|
-
let newIndex = (history.state && history.state._careersNavIndex != null)
|
|
72
|
-
? history.state._careersNavIndex
|
|
73
|
-
: (window._careersNavIndex || 0);
|
|
74
|
-
|
|
75
|
-
if (window._careersNavIndex != null) {
|
|
76
|
-
if (newIndex < window._careersNavIndex) {
|
|
77
|
-
navDirection = 'backward';
|
|
78
|
-
} else if (newIndex > window._careersNavIndex) {
|
|
79
|
-
navDirection = 'forward';
|
|
80
|
-
} else {
|
|
81
|
-
navDirection = null;
|
|
82
|
-
}
|
|
83
|
-
window._careersNavIndex = newIndex;
|
|
84
|
-
}
|
|
85
|
-
// You can use navDirection in your logic as needed
|
|
86
|
-
// Example: console.log('Navigation direction:', navDirection);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// On each navigation (including programmatic changes), increment the index, and push the state:
|
|
90
|
-
if (typeof history !== "undefined" && typeof window !== "undefined") {
|
|
91
|
-
window._careersNavIndex = window._careersNavIndex || 0;
|
|
92
|
-
if (!history.state || history.state._careersNavIndex == null) {
|
|
93
|
-
// Only set if not already set by another navigation
|
|
94
|
-
history.replaceState(
|
|
95
|
-
Object.assign({}, history.state, { _careersNavIndex: window._careersNavIndex }),
|
|
96
|
-
''
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
// Whenever you push a new URL (not popstate), increment:
|
|
100
|
-
// window._careersNavIndex++;
|
|
101
|
-
// history.pushState(
|
|
102
|
-
// Object.assign({}, history.state, { _careersNavIndex: window._careersNavIndex }),
|
|
103
|
-
// ''
|
|
104
|
-
// );
|
|
105
|
-
}
|
|
106
|
-
// INSERT_YOUR_CODE
|
|
107
|
-
if (navDirection) {
|
|
108
|
-
console.log('Navigation direction:', navDirection);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
55
|
urlOnchangeIsActive=true;
|
|
116
56
|
await handleBackAndForth(_$w);
|
|
117
57
|
urlOnchangeIsActive=false;
|
|
@@ -129,7 +69,7 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
|
129
69
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
|
|
130
70
|
await clearAll(_$w);
|
|
131
71
|
});
|
|
132
|
-
if (await
|
|
72
|
+
if (await wixWindow.formFactor() === "Mobile") {
|
|
133
73
|
handleFilterInMobile(_$w);
|
|
134
74
|
}
|
|
135
75
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_MULTI_STATE_BOX).changeState("results");
|
|
@@ -140,7 +80,7 @@ async function handleBackAndForth(_$w){
|
|
|
140
80
|
|
|
141
81
|
|
|
142
82
|
const newQueryParams=await location.query();
|
|
143
|
-
|
|
83
|
+
selectedParamsList.push(newQueryParams);
|
|
144
84
|
|
|
145
85
|
|
|
146
86
|
|