@total_onion/onion-library 2.0.229 → 2.0.231

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.
@@ -57,7 +57,7 @@ export const devContentPets = [
57
57
  categories: [13, 3, 9, 4]
58
58
  },
59
59
  {
60
- name: `Waking up <span class='font-secondary'>Amber</span>`,
60
+ name: `Amber <span class='font-secondary'>Waking up</span>`,
61
61
  link: 'https://totalonion.com',
62
62
  images: {
63
63
  post_image_src: amberImage
@@ -75,7 +75,7 @@ export const devContentPets = [
75
75
  categories: [12, 10, 4, 1]
76
76
  },
77
77
  {
78
- name: `Kitten <span class='font-secondary'>Ramses</span>`,
78
+ name: `Ramses<span class='font-secondary'>Kitten</span>`,
79
79
  link: 'https://totalonion.com',
80
80
  images: {
81
81
  post_image_src: ramsesKittenImage
@@ -84,7 +84,7 @@ export const devContentPets = [
84
84
  categories: [12, 2, 10, 4]
85
85
  },
86
86
  {
87
- name: `Mad Face <span class='font-secondary'>Lulu</span>`,
87
+ name: `Lulu<span class='font-secondary'>Mad Face</span>`,
88
88
  link: 'https://totalonion.com',
89
89
  images: {
90
90
  post_image_src: luluMadImage
@@ -93,7 +93,7 @@ export const devContentPets = [
93
93
  categories: [14, 10, 5, 1]
94
94
  },
95
95
  {
96
- name: `Pete having a <span class='font-secondary'>Bath/Drink</span>`,
96
+ name: `Pete <span class='font-secondary'>having a Bath/Drink</span>`,
97
97
  link: 'https://totalonion.com',
98
98
  images: {
99
99
  post_image_src: peteBath
@@ -111,7 +111,7 @@ export const devContentPets = [
111
111
  categories: [13, 10, 4, 1]
112
112
  },
113
113
  {
114
- name: `Dinosaur <span class='font-secondary'>Pete</span>`,
114
+ name: `Pete <span class='font-secondary'>Dinosaur</span>`,
115
115
  link: 'https://totalonion.com',
116
116
  images: {
117
117
  post_image_src: peteDinosaur
@@ -120,7 +120,7 @@ export const devContentPets = [
120
120
  categories: [13, 10, 4, 1]
121
121
  },
122
122
  {
123
- name: `Is it dinner time? <span class='font-secondary'>Vanille</span>`,
123
+ name: `Vanille <span class='font-secondary'>Is it dinner time?</span>`,
124
124
  link: 'https://totalonion.com',
125
125
  images: {
126
126
  post_image_src: vanillePuppyFace
@@ -129,7 +129,7 @@ export const devContentPets = [
129
129
  categories: [14, 10, 5, 3]
130
130
  },
131
131
  {
132
- name: `Cutie <span class='font-secondary'>Fat Gigio</span>`,
132
+ name: `Fat Gigio <span class='font-secondary'>Cutie</span>`,
133
133
  link: 'https://totalonion.com',
134
134
  images: {
135
135
  post_image_src: fatGigioSleepy
@@ -156,7 +156,7 @@ export const devContentPets = [
156
156
  categories: [2, 13, 8]
157
157
  },
158
158
  {
159
- name: `Party Dress <span class='font-secondary'>Vanille</span>`,
159
+ name: `Vanille <span class='font-secondary'>Party Dress</span>`,
160
160
  link: 'https://totalonion.com',
161
161
  images: {
162
162
  post_image_src: vanillePartyDress
@@ -165,7 +165,7 @@ export const devContentPets = [
165
165
  categories: [14, 10, 4, 1]
166
166
  },
167
167
  {
168
- name: `Sky Puppy <span class='font-secondary'>Good Dog</span>`,
168
+ name: `Sky <span class='font-secondary'>Good Dog</span>`,
169
169
  link: 'https://totalonion.com',
170
170
  images: {
171
171
  post_image_src: skyPuppyGood
@@ -174,7 +174,7 @@ export const devContentPets = [
174
174
  categories: [12, 10, 4, 1]
175
175
  },
176
176
  {
177
- name: `Kitten <span class='font-secondary'>Fat Gigio</span>`,
177
+ name: `Fat Gigio <span class='font-secondary'>Kitten</span>`,
178
178
  link: 'https://totalonion.com',
179
179
  images: {
180
180
  post_image_src: fatGigioKitten
@@ -183,7 +183,7 @@ export const devContentPets = [
183
183
  categories: [12, 10, 5, 1]
184
184
  },
185
185
  {
186
- name: `Security Corps <span class='font-secondary'>Sky</span>`,
186
+ name: `Sky <span class='font-secondary'>Security Corps</span>`,
187
187
  link: 'https://totalonion.com',
188
188
  images: {
189
189
  post_image_src: skySecurity
@@ -70,7 +70,7 @@ export const devContentPets = [
70
70
  categories: [13, 3, 9, 4]
71
71
  },
72
72
  {
73
- name: `Waking up <span class='font-secondary'>Amber</span>`,
73
+ name: `Amber <span class='font-secondary'>Waking up</span>`,
74
74
  link: 'https://totalonion.com',
75
75
  images: {
76
76
  post_image_src: amberImage
@@ -88,7 +88,7 @@ export const devContentPets = [
88
88
  categories: [12, 10, 4, 1]
89
89
  },
90
90
  {
91
- name: `Kitten <span class='font-secondary'>Ramses</span>`,
91
+ name: `Ramses<span class='font-secondary'>Kitten</span>`,
92
92
  link: 'https://totalonion.com',
93
93
  images: {
94
94
  post_image_src: ramsesKittenImage
@@ -97,7 +97,7 @@ export const devContentPets = [
97
97
  categories: [12, 2, 10, 4]
98
98
  },
99
99
  {
100
- name: `Mad Face <span class='font-secondary'>Lulu</span>`,
100
+ name: `Lulu<span class='font-secondary'>Mad Face</span>`,
101
101
  link: 'https://totalonion.com',
102
102
  images: {
103
103
  post_image_src: luluMadImage
@@ -106,7 +106,7 @@ export const devContentPets = [
106
106
  categories: [14, 10, 5, 1]
107
107
  },
108
108
  {
109
- name: `Pete having a <span class='font-secondary'>Bath/Drink</span>`,
109
+ name: `Pete <span class='font-secondary'>having a Bath/Drink</span>`,
110
110
  link: 'https://totalonion.com',
111
111
  images: {
112
112
  post_image_src: peteBath
@@ -124,7 +124,7 @@ export const devContentPets = [
124
124
  categories: [13, 10, 4, 1]
125
125
  },
126
126
  {
127
- name: `Dinosaur <span class='font-secondary'>Pete</span>`,
127
+ name: `Pete <span class='font-secondary'>Dinosaur</span>`,
128
128
  link: 'https://totalonion.com',
129
129
  images: {
130
130
  post_image_src: peteDinosaur
@@ -133,7 +133,7 @@ export const devContentPets = [
133
133
  categories: [13, 10, 4, 1]
134
134
  },
135
135
  {
136
- name: `Is it dinner time? <span class='font-secondary'>Vanille</span>`,
136
+ name: `Vanille <span class='font-secondary'>Is it dinner time?</span>`,
137
137
  link: 'https://totalonion.com',
138
138
  images: {
139
139
  post_image_src: vanillePuppyFace
@@ -142,7 +142,7 @@ export const devContentPets = [
142
142
  categories: [14, 10, 5, 3]
143
143
  },
144
144
  {
145
- name: `Cutie <span class='font-secondary'>Fat Gigio</span>`,
145
+ name: `Fat Gigio <span class='font-secondary'>Cutie</span>`,
146
146
  link: 'https://totalonion.com',
147
147
  images: {
148
148
  post_image_src: fatGigioSleepy
@@ -169,7 +169,7 @@ export const devContentPets = [
169
169
  categories: [2, 13, 8]
170
170
  },
171
171
  {
172
- name: `Party Dress <span class='font-secondary'>Vanille</span>`,
172
+ name: `Vanille <span class='font-secondary'>Party Dress</span>`,
173
173
  link: 'https://totalonion.com',
174
174
  images: {
175
175
  post_image_src: vanillePartyDress
@@ -178,7 +178,7 @@ export const devContentPets = [
178
178
  categories: [14, 10, 4, 1]
179
179
  },
180
180
  {
181
- name: `Sky Puppy <span class='font-secondary'>Good Dog</span>`,
181
+ name: `Sky <span class='font-secondary'>Good Dog</span>`,
182
182
  link: 'https://totalonion.com',
183
183
  images: {
184
184
  post_image_src: skyPuppyGood
@@ -187,7 +187,7 @@ export const devContentPets = [
187
187
  categories: [12, 10, 4, 1]
188
188
  },
189
189
  {
190
- name: `Kitten <span class='font-secondary'>Fat Gigio</span>`,
190
+ name: `Fat Gigio <span class='font-secondary'>Kitten</span>`,
191
191
  link: 'https://totalonion.com',
192
192
  images: {
193
193
  post_image_src: fatGigioKitten
@@ -196,7 +196,7 @@ export const devContentPets = [
196
196
  categories: [12, 10, 5, 1]
197
197
  },
198
198
  {
199
- name: `Security Corps <span class='font-secondary'>Sky</span>`,
199
+ name: `Sky <span class='font-secondary'>Security Corps</span>`,
200
200
  link: 'https://totalonion.com',
201
201
  images: {
202
202
  post_image_src: skySecurity
@@ -4,7 +4,7 @@
4
4
  data-dev="true"
5
5
  data-devdatalocation="local"
6
6
  data-clearfilterstext="Reset All"
7
- data-loadmoretriggerclass="loadmore-trigger__button"
7
+ data-loadmoretriggerclass="loadmore-trigger"
8
8
  class="post-filter-module"
9
9
  >
10
10
  </post-filter-module>
@@ -14,6 +14,9 @@ export default function postfiltermoduleJs(options = {}) {
14
14
  allcategories: [],
15
15
  groupingcategories: [],
16
16
  filtercategories: [],
17
+ postsperpagedesktop: 8,
18
+ postsperpagemobile: 6,
19
+ pagenumber: 1,
17
20
  setActiveFilters: function (newState) {
18
21
  Object.assign(this.filterState, newState);
19
22
  this.filterPosts.bind(this)();
@@ -31,9 +34,21 @@ export default function postfiltermoduleJs(options = {}) {
31
34
  }
32
35
  };
33
36
 
37
+ this.filterState.postsperpagedesktop =
38
+ this.dataset.postsperpagedesktop || 8;
39
+ this.filterState.postsperpagedesktop =
40
+ this.dataset.postsperpagedesktop || 6;
41
+
34
42
  this.loadMoreTriggers = document.querySelectorAll(
35
- `.${this.loadmoretriggerclass}`
43
+ `.${this.dataset.loadmoretriggerclass}`
36
44
  );
45
+ this.loadMoreTriggers.forEach((trigger) => {
46
+ trigger.addEventListener('loadmore', () => {
47
+ this.filterState.pagenumber =
48
+ this.filterState.pagenumber + 1;
49
+ this.filterPosts();
50
+ });
51
+ });
37
52
 
38
53
  const postFilterContainer =
39
54
  document.createElement('div');
@@ -200,9 +215,6 @@ export default function postfiltermoduleJs(options = {}) {
200
215
  }
201
216
  });
202
217
  });
203
- this.filterState.setFilteredPosts.bind(this)({
204
- filteredposts: this.filterState.allposts
205
- });
206
218
  const groupingButtons = this.querySelectorAll(
207
219
  '.post-filter-module__grouping-category-button'
208
220
  );
@@ -239,6 +251,8 @@ export default function postfiltermoduleJs(options = {}) {
239
251
  }
240
252
  });
241
253
  });
254
+ this.filterPosts();
255
+
242
256
  this.classList.add('loaded');
243
257
  }
244
258
 
@@ -247,8 +261,14 @@ export default function postfiltermoduleJs(options = {}) {
247
261
  }
248
262
  filterPosts(event) {
249
263
  if (this.filterState.activefilters.size === 0) {
264
+ const numberPosts =
265
+ Number(this.filterState.postsperpagedesktop) *
266
+ Number(this.filterState.pagenumber);
250
267
  this.filterState.setFilteredPosts.bind(this)({
251
- filteredposts: this.filterState.allposts
268
+ filteredposts: this.filterState.allposts.slice(
269
+ 0,
270
+ numberPosts
271
+ )
252
272
  });
253
273
  return;
254
274
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "2.0.229",
3
+ "version": "2.0.231",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {