Photogallery masonry javascript on mobile

Created on 4 March 2021, about 4 years ago
Updated 12 February 2025, about 2 months ago

Problem/Motivation

The photo gallery paragraph has an issue with the javascript.
On mobile the javascript is still loaded so the inline theming remains.
When you scale your screen the inline theming is also not cleaned up even with this quick fix.

I think the issue is the same for both gallery options. When scaling to mobile the spacing isn't correct.
But the main issue is on masonry.

Steps to reproduce

Add a photo gallery paragraph with masonry.

Proposed resolution

// check for masonry layout
      if (paragraph.length) {
        self.optimizedResize().add(function() {
          if ((self.screen !== 'xs' )) {
            self.masonry(paragraph, context);
          }
        });
      }

Remaining tasks

Clean the inline style after resizing from desktop to mobile

🐛 Bug report
Status

Closed: won't fix

Component

Code

Created by

🇧🇪Belgium brentmeuleman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024