Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
const instance = flickity.data(element)
if (instance) {
// Return the instance
return resolve(instance);
} else {
return reject('Instance not found for ' + element);
}
});
}
wrapAround: thumbnails.length >= 3,
setGallerySize: false,
pageDots: false,
imagesLoaded: true,
lazyLoad: 1,
arrowShape: {
x0: 30,
x1: 63.5,
y1: 50,
x2: 70,
y2: 45.5,
x3: 40
}
});
var flkty = Flickity.data(carousel);
ctx.carousel.on('select', function () {
if (navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) {
document.querySelector('#openseadragon').style.width = '100%';
}
Array.prototype.slice.call(thumbnails).forEach((el) => {
el.classList.remove('record-imgpanel__thumb--selected');
});
if (thumbnails[flkty.selectedIndex]) {
thumbnails[flkty.selectedIndex].classList.add('record-imgpanel__thumb--selected');
captions.forEach((el) => showHide('record-imgpanel__caption', flkty, el));
zooms.forEach((el) => showHide('openseadragon-toolbar', flkty, el));
rights.forEach((el) => showHide('cite__method', flkty, el));
useImage.forEach((el) => showHide('cite__button', flkty, el));
}
});