diff --git a/photologue/static/gallery_detail.js b/photologue/static/gallery_detail.js index bd4f8d2..f1c30fe 100644 --- a/photologue/static/gallery_detail.js +++ b/photologue/static/gallery_detail.js @@ -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); +});