Gallery icon indicating copy to clipboard operation
Gallery copied to clipboard

using WebPack

Open adampatterson opened this issue 3 years ago • 1 comments

I loaded the script through NPM and am importing blueimp like so import blueimp, from 'blueimp-gallery'

My config looks like this.

    document.getElementById('gallery').onclick = function (event) {
        event = event || window.event
        var target = event.target || event.srcElement,
            link = target.src ? target.parentNode : target,
            options = {
                index: link,
                event: event
            },
            links = this.getElementsByTagName('a')
        blueimp(links, options)
    }

I am not sure how to get the indicators to work. The examples show loading a separate file for the indicators.

I see indicatorOptions but don't see how they apply to the options.

If it's possible can I get an example? Otherwise, I will probably use a CDN for the files as I don't want to upload the NPM folder.

Thanks for the help!

adampatterson avatar Feb 25 '22 01:02 adampatterson

I ended up loading the files individually.

adampatterson avatar Feb 26 '22 01:02 adampatterson

Hi @adampatterson,

I also import it individually:

import Gallery from 'blueimp-gallery';
import 'blueimp-gallery/js/blueimp-gallery-indicator';

And inside your options-object, you can specify more options:

            indicatorContainer: 'ol',
            thumbnailProperty: 'thumbnail',
            thumbnailIndicators: true,

I think this issue can be closed 👍

sebastian-marinescu avatar May 01 '23 12:05 sebastian-marinescu