sr-npm 1.7.880 → 1.7.882
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 +1 -1
- package/pages/homePage.js +25 -1
package/package.json
CHANGED
package/pages/homePage.js
CHANGED
|
@@ -10,6 +10,7 @@ const { COLLECTIONS } = require('../backend/collectionConsts');
|
|
|
10
10
|
const { bindPrimarySearch,getAllRecords,loadPrimarySearchRepeater } = require('./pagesUtils');
|
|
11
11
|
let thisObjectVar;
|
|
12
12
|
let searchByCityFlag=false;
|
|
13
|
+
let loadedCategories=false;
|
|
13
14
|
async function homePageOnReady(_$w,thisObject=null) {
|
|
14
15
|
|
|
15
16
|
const queryResult = await wixData.query(COLLECTIONS.SITE_CONFIGS).find();
|
|
@@ -20,7 +21,9 @@ async function homePageOnReady(_$w,thisObject=null) {
|
|
|
20
21
|
await Promise.all([
|
|
21
22
|
bindPrimarySearch(_$w,allvaluesobjects,allJobs),
|
|
22
23
|
loadPrimarySearchRepeater(_$w),
|
|
23
|
-
bindTeamRepeater(_$w)
|
|
24
|
+
bindTeamRepeater(_$w),
|
|
25
|
+
bindViewAllButton(_$w),
|
|
26
|
+
|
|
24
27
|
]);
|
|
25
28
|
}
|
|
26
29
|
else{
|
|
@@ -82,6 +85,27 @@ function bindTeamRepeater(_$w) {
|
|
|
82
85
|
});
|
|
83
86
|
}
|
|
84
87
|
|
|
88
|
+
function bindViewAllButton(_$w) {
|
|
89
|
+
if(!loadedCategories) {
|
|
90
|
+
loadedCategories=true;
|
|
91
|
+
_$w('#viewAllCategoriesButton').label = "View All";
|
|
92
|
+
_$w('#viewAllCategoriesButton').onClick(()=>{
|
|
93
|
+
console.log("loading more categories");
|
|
94
|
+
_$w("#categoriesDataset").loadMore();
|
|
95
|
+
console.log("categories loaded");
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
else
|
|
99
|
+
{
|
|
100
|
+
loadedCategories=false;
|
|
101
|
+
_$w('#viewAllCategoriesButton').label = "View Less";
|
|
102
|
+
_$w('#viewAllCategoriesButton').onClick(()=>{
|
|
103
|
+
_$w("#categoriesDataset").loadPage(0);
|
|
104
|
+
console.log("categories reseted");
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
85
109
|
function init(_$w) {
|
|
86
110
|
const debouncedInput = debounce(()=>handleSearchInput(_$w), 400,thisObjectVar);
|
|
87
111
|
|