Skip to content

[PRO] Props not being passed to refreshFsLightbox() #220

@BrookeDot

Description

@BrookeDot

I'm not sure if this is a doing_it_wrong situation or a bug, but I have a global instance of fsLightbox defined as:

  if (typeof fsLightbox !== "undefined") { 
    fsLightbox.props.exitFullscreenOnClose = true;
    fsLightbox.props.disableThumbs = true;
  }

This disables the default full screen behavior and removes the thumbnail button.

It works for any images that are added at load time, however, I use infinite scroll, so I added the following to refresh the lightbox as new images are added:

 infScroll.on( 'append', function() {
            if (typeof fsLightbox !== "undefined") { 
                if (window.fsLightbox) {
                    refreshFsLightbox();
                }
             }
        });

Looking at the refer refreshFsLightbox source there should be a temp var that holds the value and passes it, but for the life of me I can't seem to pass the value correctly to have my settings pass to the new lightbox instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions