From ab636df83d38a2d2c0780a74dccb8f9567e92e64 Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Thu, 14 Sep 2023 14:57:33 -0400 Subject: [PATCH] Highlight selected template --- web/index.css | 4 ++++ web/index.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/web/index.css b/web/index.css index 3efd9cb..0eb633b 100644 --- a/web/index.css +++ b/web/index.css @@ -48,6 +48,10 @@ height: 100px; } +.template-selected { + background-color: green; +} + .template div { border: 1px solid; } diff --git a/web/index.js b/web/index.js index 35c1b1e..dbddbfc 100644 --- a/web/index.js +++ b/web/index.js @@ -204,8 +204,10 @@ function pageSizeChange() { * @param {HTMLDivElement} templateDiv */ function applyTemplate(templateDiv) { + document.getElementsByClassName("template-selected").item(0)?.classList.remove("template-selected") /** @type {HTMLDivElement} */ const templateClone = templateDiv.cloneNode(true) + templateDiv.classList.add("template-selected") for (const index in imageUrls) { const url = imageUrls[index] const imgClass = `img${index}`