Properly reset internal state in image viewer widget
authorMatthias Schmidt <gravatronics@live.com>
Tue, 11 May 2021 06:56:21 +0000 (08:56 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 11 May 2021 06:56:21 +0000 (08:56 +0200)
See #3835

wcfsetup/install/files/js/WCF.ImageViewer.js

index fa61f9a1406aa37e71f0b0f4bf12352ffb3d05ef..54ca2cbf12699b7175b8e9c4de1a12d91c038320 100644 (file)
@@ -366,6 +366,9 @@ $.widget('ui.wcfImageViewer', {
 
                        // Reset the internal state because it could refer to a different set of images.
                        this._active = -1;
+                       if (this._activeImage !== null) {
+                               this._ui.images[this._activeImage].removeClass('active');
+                       }
                        this._activeImage = null;
 
                        var $images = this._getStaticImages();