@asd20/ui 3.2.459 → 3.2.461

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.
@@ -38,7 +38,7 @@ export default {
38
38
  'Donec id elit non mi porta gravida at eget metus.',
39
39
  }),
40
40
 
41
- Array(3).fill({
41
+ Array(5).fill({
42
42
  category: 'Image Links',
43
43
  type: 'Link',
44
44
  id: 'edd36f00-2373-11eb-88e6-97a01f897919',
@@ -1,4 +1,7 @@
1
1
  export default {
2
+ data: () => ({
3
+ desktop: true,
4
+ }),
2
5
  props: {
3
6
  // Page meta
4
7
  id: { type: String, default: '' },
@@ -203,14 +206,13 @@ export default {
203
206
  widgetsSectionProps() {
204
207
  /*
205
208
  Rules:
206
- - Sidebar only shown if more than one message, or the first message has bodyHtml
209
+ - Sidebar only shown if more than one message, or the first message has bodyHtml, or screen width is > 1024
207
210
  - Sidebar widgets move to Footer when sidebar is not present
208
- - If both sidebar and footer widgets are shown, prefer placing them in sidebar
209
211
  - Full-width widgets are placed in the footer only
210
- - If related links contain images, they become full-width
211
212
  */
212
213
 
213
- const useSidebar = this.firstMessage && this.firstMessage.bodyHtml
214
+ const useSidebar =
215
+ this.firstMessage && this.firstMessage.bodyHtml && this.desktop
214
216
 
215
217
  const relatedLinksContainImages =
216
218
  this.relatedLinks.length && !!this.relatedLinks.find(l => !!l.imageUrl)
@@ -231,20 +233,21 @@ export default {
231
233
  filesFeedProps: this.filesFeedProps,
232
234
  }
233
235
 
234
- if (!useSidebar) {
235
- footer.relatedPages = this.relatedPages
236
- footer.group = this.group
237
- footer.events = this.events || []
238
- footer.eventsFeedProps = this.eventsFeedProps
239
- }
240
-
241
- if (this.relatedLinks.length > 10 || !useSidebar) {
236
+ if (this.relatedLinks.length > 15 && relatedLinksContainImages) {
242
237
  footer.relatedLinks = this.relatedLinks.filter(l => l.imageUrl)
243
238
  sidebar.relatedLinks = this.relatedLinks.filter(l => !l.imageUrl)
244
239
  } else {
245
240
  sidebar.relatedLinks = this.relatedLinks || []
246
241
  }
247
242
 
243
+ if (!useSidebar) {
244
+ footer.relatedPages = this.relatedPages
245
+ footer.relatedLinks = this.relatedLinks
246
+ // footer.group = this.group
247
+ // footer.events = this.events || []
248
+ // footer.eventsFeedProps = this.eventsFeedProps
249
+ }
250
+
248
251
  const useFooter =
249
252
  footer.relatedPages.length ||
250
253
  footer.relatedLinks.length ||
@@ -301,4 +304,13 @@ export default {
301
304
  ]
302
305
  },
303
306
  },
307
+ mounted() {
308
+ this.desktop = window.innerWidth >= 1024
309
+ window.addEventListener('resize', this.handleResize)
310
+ },
311
+ methods: {
312
+ handleResize() {
313
+ this.desktop = window.innerWidth >= 1024
314
+ },
315
+ },
304
316
  }