From 741fe62be457cd1f418d9a0b296de3d870d204f4 Mon Sep 17 00:00:00 2001 From: Juan Treminio Date: Fri, 7 Nov 2025 21:09:45 -0600 Subject: [PATCH] Highlight current image in the history container --- .../js/genpage/gentab/currentimagehandler.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/wwwroot/js/genpage/gentab/currentimagehandler.js b/src/wwwroot/js/genpage/gentab/currentimagehandler.js index 06df58d2e..d66b5ef89 100644 --- a/src/wwwroot/js/genpage/gentab/currentimagehandler.js +++ b/src/wwwroot/js/genpage/gentab/currentimagehandler.js @@ -974,6 +974,21 @@ function setCurrentImage(src, metadata = '', batchId = '', previewGrow = false, } } } + let historyContainer = document.getElementById('imagehistorybrowser-content'); + if (historyContainer) { + let normalizedSrc = getImageFullSrc(src); + for (let i of historyContainer.getElementsByClassName('image-block')) { + // History browser images may have data-src (if clicked) or just data-name (if not clicked yet) + let historyImgSrc = i.dataset.src || i.dataset.name; + let normalizedHistorySrc = historyImgSrc ? getImageFullSrc(historyImgSrc) : null; + if (normalizedHistorySrc && normalizedSrc == normalizedHistorySrc) { + i.classList.add('image-block-current'); + } + else { + i.classList.remove('image-block-current'); + } + } + } } /** Gets the container div element for a generated image to put into, in the batch output view. If Separate Batches is enabled, will use or create a per-batch container. */