sr-npm 1.7.1284 → 1.7.1286

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.1284",
3
+ "version": "1.7.1286",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
-
4
- const { window:wixWindow } = require('@wix/site-window');
3
+ const { wixWindow } = require('wix-window');
4
+ const { window } = 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 = {
@@ -51,67 +50,9 @@ const pagination = {
51
50
 
52
51
  async function careersMultiBoxesPageOnReady(_$w,urlParams) {
53
52
  //to handle back and forth , url changes
54
- selectedParamsList.push(urlParams);
53
+
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
-
55
+ console.log("wixwindow.refere",wixWindow.referrer);
115
56
  urlOnchangeIsActive=true;
116
57
  await handleBackAndForth(_$w);
117
58
  urlOnchangeIsActive=false;
@@ -129,10 +70,11 @@ async function careersMultiBoxesPageOnReady(_$w,urlParams) {
129
70
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
130
71
  await clearAll(_$w);
131
72
  });
132
- if (await wixWindow.formFactor() === "Mobile") {
73
+ if (await window.formFactor() === "Mobile") {
133
74
  handleFilterInMobile(_$w);
134
75
  }
135
76
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_MULTI_STATE_BOX).changeState("results");
77
+ selectedParamsList.push(urlParams);
136
78
  }
137
79
 
138
80
  async function handleBackAndForth(_$w){
@@ -140,7 +82,7 @@ async function handleBackAndForth(_$w){
140
82
 
141
83
 
142
84
  const newQueryParams=await location.query();
143
- selectedParamsStack.push(newQueryParams);
85
+ selectedParamsList.push(newQueryParams);
144
86
 
145
87
 
146
88