Skip to content

Problem on mobile when catalog gallery allowfullscreen is false #2818

Closed
@tigerx7

Description

@tigerx7

When passing false to allowfullscreen via the theme's view.xml successfully deactivates the full screen feature of the product's gallery, on mobile devices (or touch capable), top level .page-wrapper is still hidden rendering a blank page upon tapping the image.

Steps to reproduce:

  1. In theme's view.xml, set gallery's allowfullscreen variable to false.
  2. Flush cache and static files.
  3. Go to a product page with an image on a mobile touch capable device. Tap on the image.

I found that in lib/mage/gallery/gallery.js, even when allowfullscreen = false may be preventing the popup, code is still being executed that hides the page-wrapper.

/lib/web/mage/gallery/gallery.js line 129-138

if (this.isTouchEnabled) {
    this.settings.$element.on('tap', '.fotorama__stage__frame', function () {
        var translate = getTranslate($(this).parents('.fotorama__stage__shaft'));

        if (translate[1] === '0' && !$(this).hasClass('fotorama-video-container')) {
            self.openFullScreen();
            self.settings.$pageWrapper.hide();
        }
    });
}

Best case would probably be to check allowfullscreen prior to self.settings.$pageWrapper.hide();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions