fix: add gallery exists check

This commit is contained in:
Matthieu Bessat 2020-08-19 11:56:38 +02:00
parent d29d1a0212
commit 014e51640c

View file

@ -164,6 +164,7 @@ let closeModal = () => {
} }
} }
if (document.querySelector('.media-mosaic') != null) {
navLeft.onclick = () => { navLeft.onclick = () => {
if (mediaData.indexOf(currentMedia) === 0) { return; } if (mediaData.indexOf(currentMedia) === 0) { return; }
currentMedia = mediaData[mediaData.indexOf(currentMedia) - 1] currentMedia = mediaData[mediaData.indexOf(currentMedia) - 1]
@ -175,6 +176,7 @@ navRight.onclick = () => {
currentMedia = mediaData[mediaData.indexOf(currentMedia) + 1] currentMedia = mediaData[mediaData.indexOf(currentMedia) + 1]
fillModal() fillModal()
} }
}
/** /**
* Decode things * Decode things