fix: add gallery exists check
This commit is contained in:
parent
d29d1a0212
commit
014e51640c
1 changed files with 11 additions and 9 deletions
|
@ -164,16 +164,18 @@ let closeModal = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
navLeft.onclick = () => {
|
if (document.querySelector('.media-mosaic') != null) {
|
||||||
|
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]
|
||||||
fillModal()
|
fillModal()
|
||||||
}
|
}
|
||||||
|
|
||||||
navRight.onclick = () => {
|
navRight.onclick = () => {
|
||||||
if (mediaData.indexOf(currentMedia) + 1 === mediaData.length) { return; }
|
if (mediaData.indexOf(currentMedia) + 1 === mediaData.length) { return; }
|
||||||
currentMedia = mediaData[mediaData.indexOf(currentMedia) + 1]
|
currentMedia = mediaData[mediaData.indexOf(currentMedia) + 1]
|
||||||
fillModal()
|
fillModal()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue