From 444c5835c9e99750fad5e4c58e6cd3ffd3dd4543 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Fri, 8 Mar 2024 10:59:34 +0100 Subject: [PATCH] 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 --- modules/services/mapilio.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/services/mapilio.js b/modules/services/mapilio.js index 390fb2386..ab63c3529 100644 --- a/modules/services/mapilio.js +++ b/modules/services/mapilio.js @@ -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('►');