diff --git a/layouts/partials/body/photoswipe.html b/layouts/partials/body/photoswipe.html index 7ffefca..4f826a8 100644 --- a/layouts/partials/body/photoswipe.html +++ b/layouts/partials/body/photoswipe.html @@ -87,6 +87,7 @@ document.addEventListener('DOMContentLoaded', function () { } } + var modal = document.getElementById('modal'); var singleContentsElem = document.querySelector('.single__contents'); var swipeWrapElem = document.querySelector('.swipe-wrap'); var mySwipeElem = document.getElementById('mySwipe'); @@ -103,9 +104,13 @@ document.addEventListener('DOMContentLoaded', function () { var mySwipe = null; var keydownFunction = function (e) { if (e.key === 'ArrowRight') { - mySwipe.next(); + if (modal && modal.classList.contains('is-open')) { + mySwipe.next(); + } } else if (e.key === 'ArrowLeft') { - mySwipe.prev(); + if (modal && modal.classList.contains('is-open')) { + mySwipe.prev(); + } } } diff --git a/layouts/partials/script/gallery-script.html b/layouts/partials/script/gallery-script.html index 2ca75bd..081fbe4 100644 --- a/layouts/partials/script/gallery-script.html +++ b/layouts/partials/script/gallery-script.html @@ -29,7 +29,6 @@ e.target.parentNode.previousElementSibling.click(); } elem.querySelector('.grid-item__desc').onclick = function(e) { - console.log('eee'); e.target.previousElementSibling.click(); } });