I’m using Photobrowser for an image gallery and the user can delete photos that they’ve uploaded. Here’s my delete function:
app.dialog.confirm('Are you sure you want to delete this image?', function () {
myPhotoBrowser.params.photos.splice(myPhotoBrowser.activeIndex,1);
myPhotoBrowser.swiper.removeSlide(myPhotoBrowser.activeIndex);
myPhotoBrowser.swiper.update();
});
The image is removed by swiper.removeSlide()
, but the empty slide remains and swiping is confused by the missing slide. I was hoping that the PhotoBrowser component would be listening to swiper.update()
, but that doesn’t seem to do anything.
Any ideas for how to get the PhotoBrowser to update?