sr-npm 1.7.881 → 1.7.883

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pages/homePage.js +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.881",
3
+ "version": "1.7.883",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
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();
@@ -85,12 +86,25 @@ function bindTeamRepeater(_$w) {
85
86
  }
86
87
 
87
88
  function bindViewAllButton(_$w) {
89
+ if(!loadedCategories) {
90
+ loadedCategories=true;
91
+ _$w('#viewAllCategoriesButton').label = "View All";
88
92
  _$w('#viewAllCategoriesButton').onClick(()=>{
89
93
  console.log("loading more categories");
90
94
  _$w("#categoriesDataset").loadMore();
91
95
  console.log("categories loaded");
92
96
  });
93
97
  }
98
+ else
99
+ {
100
+ loadedCategories=false;
101
+ _$w('#viewAllCategoriesButton').label = "View Less";
102
+ _$w('#viewAllCategoriesButton').onClick(()=>{
103
+ _$w("#categoriesDataset").loadPage(1);
104
+ console.log("categories reseted");
105
+ });
106
+ }
107
+ }
94
108
 
95
109
  function init(_$w) {
96
110
  const debouncedInput = debounce(()=>handleSearchInput(_$w), 400,thisObjectVar);