gallery keyboard bug fixed
This commit is contained in:
parent
e46c44fa35
commit
4e696f2adb
|
@ -87,6 +87,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var modal = document.getElementById('modal');
|
||||||
var singleContentsElem = document.querySelector('.single__contents');
|
var singleContentsElem = document.querySelector('.single__contents');
|
||||||
var swipeWrapElem = document.querySelector('.swipe-wrap');
|
var swipeWrapElem = document.querySelector('.swipe-wrap');
|
||||||
var mySwipeElem = document.getElementById('mySwipe');
|
var mySwipeElem = document.getElementById('mySwipe');
|
||||||
|
@ -103,11 +104,15 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||||
var mySwipe = null;
|
var mySwipe = null;
|
||||||
var keydownFunction = function (e) {
|
var keydownFunction = function (e) {
|
||||||
if (e.key === 'ArrowRight') {
|
if (e.key === 'ArrowRight') {
|
||||||
|
if (modal && modal.classList.contains('is-open')) {
|
||||||
mySwipe.next();
|
mySwipe.next();
|
||||||
|
}
|
||||||
} else if (e.key === 'ArrowLeft') {
|
} else if (e.key === 'ArrowLeft') {
|
||||||
|
if (modal && modal.classList.contains('is-open')) {
|
||||||
mySwipe.prev();
|
mySwipe.prev();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MicroModal.init({
|
MicroModal.init({
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
e.target.parentNode.previousElementSibling.click();
|
e.target.parentNode.previousElementSibling.click();
|
||||||
}
|
}
|
||||||
elem.querySelector('.grid-item__desc').onclick = function(e) {
|
elem.querySelector('.grid-item__desc').onclick = function(e) {
|
||||||
console.log('eee');
|
|
||||||
e.target.previousElementSibling.click();
|
e.target.previousElementSibling.click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue