hide forward/back button if there is no matching image

e.g. for the first/last photo in a sequence, or when there are gaps
This commit is contained in:
Martin Raifer
2024-03-08 10:59:34 +01:00
parent e923c43847
commit 444c5835c9
+10
View File
@@ -377,6 +377,14 @@ export default {
.selectAll('img')
.remove();
wrap
.selectAll('button.back')
.classed('hide', !_cache.images.forImageId.hasOwnProperty(+id - 1));
wrap
.selectAll('button.forward')
.classed('hide', !_cache.images.forImageId.hasOwnProperty(+id + 1));
getImageData(d.id,d.sequence_id).then(function () {
if (d.isPano) {
@@ -467,11 +475,13 @@ export default {
controlsEnter
.append('button')
.classed('back', true)
.on('click.back', step(-1))
.text('◄');
controlsEnter
.append('button')
.classed('forward', true)
.on('click.forward', step(1))
.text('►');