Add security and a mobile download button
This commit is contained in:
parent
63b30a092a
commit
93ab619492
1 changed files with 18 additions and 0 deletions
|
|
@ -7,8 +7,15 @@
|
|||
// Init gallery
|
||||
lightGallery(document.getElementById('lightgallery'), {
|
||||
plugins: [lgAdmin, lgHash, lgThumbnail, lgZoom],
|
||||
download: true,
|
||||
customSlideName: true,
|
||||
licenseKey: '94ED9732-30284A12-B88B0137-4FF9CEE6',
|
||||
appendDownloadAttributesToAnchor: true, // Crucial pour le mobile
|
||||
mobileSettings: {
|
||||
controls: true,
|
||||
showCloseIcon: true,
|
||||
download: true // On force l'activation ici aussi
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -53,3 +60,14 @@ lgContainer.addEventListener('lgAfterOpen', () => {
|
|||
}, true); // Utilisation du mode capture pour intercepter avant le script interne
|
||||
}
|
||||
});
|
||||
|
||||
//disable downloading with the context menue
|
||||
|
||||
lgContainer.addEventListener('lgAfterOpen', () => {
|
||||
// On cible le conteneur de la galerie qui vient de s'afficher
|
||||
const lgOuter = document.querySelector('.lg-outer');
|
||||
|
||||
lgOuter.addEventListener('contextmenu', (e) => {
|
||||
e.preventDefault();
|
||||
}, false);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue