From: Matthias Schmidt Date: Tue, 11 May 2021 06:56:21 +0000 (+0200) Subject: Properly reset internal state in image viewer widget X-Git-Tag: 5.4.0_Alpha_2~5^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8d4d4093e9208c057369fe9f7371a5b91dd38a16;p=GitHub%2FWoltLab%2FWCF.git Properly reset internal state in image viewer widget See #3835 --- diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.js b/wcfsetup/install/files/js/WCF.ImageViewer.js index fa61f9a140..54ca2cbf12 100644 --- a/wcfsetup/install/files/js/WCF.ImageViewer.js +++ b/wcfsetup/install/files/js/WCF.ImageViewer.js @@ -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();