gallery keyboard bug fixed

This commit is contained in:
zzossig 2020-01-12 23:31:32 +09:00
parent e46c44fa35
commit 4e696f2adb
2 changed files with 7 additions and 3 deletions

View File

@ -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();
}
}
}

View File

@ -29,7 +29,6 @@
e.target.parentNode.previousElementSibling.click();
}
elem.querySelector('.grid-item__desc').onclick = function(e) {
console.log('eee');
e.target.previousElementSibling.click();
}
});