Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use custom gallery config while using the lightbox #104

Closed
PavolSvidran opened this issue Jun 17, 2018 · 6 comments
Closed

Cannot use custom gallery config while using the lightbox #104

PavolSvidran opened this issue Jun 17, 2018 · 6 comments
Labels
Milestone

Comments

@PavolSvidran
Copy link

PavolSvidran commented Jun 17, 2018

Hi, i use in my project ng-gallery in some components. The problem is with config ... i cant set up specific config for gallery-ref, it still using global.

I try both ways:

            this.gallery.ref('single-image-gallery', Config).load([this.imageItem]);
            this.gallery.ref('single-image-gallery').setConfig(Config);

Config look like:

Config: GalleryConfig = {
    gestures: false,
    loop: false,
    etc.....
};

But it not work. Am I doing something wrong or is there a bug?
For info: Angular version 6.

@MurhafSousli
Copy link
Owner

MurhafSousli commented Jun 17, 2018

Hi @JBeater, You can change the global config

GalleryModule.forRoot(config)

Or you can set a custom config to a gallery on initializing

let newGalleryRef = this.gallery.ref('single-image-gallery', config)

But if single-image-gallery ref is already created, the function ref() will just return it and won't set the config, so use the following instead:

let galleryRef = this.gallery.ref('single-image-gallery');
galleryRef.setConfig(config);

@PavolSvidran
Copy link
Author

I tried it.

        this.galleryRef = this.gallery.ref('single-image-gallery');
        this.galleryRef.setConfig(SingleImageGalleryConfig);
        this.galleryRef.add(this.imageItem);
        this.lightBox.open(0, 'single-image-gallery',ZfSingleImageLightBoxConfig);

But it still using global config instead of local :(

@MurhafSousli
Copy link
Owner

@JBeater Can you reproduce it in this stackbltiz

@PavolSvidran
Copy link
Author

@MurhafSousli here: try it!

@MurhafSousli
Copy link
Owner

Now I see, the lightbox is resetting the gallery ref config

@MurhafSousli MurhafSousli changed the title Gallery config Cannot use custom gallery config while using the lightbox Jun 18, 2018
@CosmoFruit
Copy link

also when:
this.gallery.ref('1', this.config).load(items);
this.lightbox.open( this.currIndex, '1');

show broken style:

  1. default config
    default
    2.in lightbox no dots
    default
  2. after closed lightbox gallery config is broke
    default

@MurhafSousli MurhafSousli added this to the v3.0.0 milestone Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants