From bd030f8cfb9b2c7ef839288ca92f0ad1c7a75047 Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Wed, 11 May 2022 13:09:17 +0700 Subject: [PATCH] Support icon-less entries --- web/_js/time.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/_js/time.js b/web/_js/time.js index 3dd3d0f9..ddffe32c 100644 --- a/web/_js/time.js +++ b/web/_js/time.js @@ -134,8 +134,16 @@ async function updateBackground(newPeriod = currentPeriod, newVariation = curren const variationConfig = variationsConfig[newVariation] variantsEl.value = currentVariation - variantsEl.previousElementSibling.innerHTML = variationConfig.icon - + if (variationConfig.icon) { + variantsEl.previousElementSibling.innerHTML = variationConfig.icon + variantsEl.previousElementSibling.classList.remove('d-none') + variantsEl.parentElement.classList.add('input-group') + } else { + variantsEl.previousElementSibling.innerHTML = "" + variantsEl.previousElementSibling.classList.add('d-none') + variantsEl.parentElement.classList.remove('input-group') + } + const configObject = variationConfig.versions[currentPeriod] if (typeof configObject.url === "string") { if (imageCache[configObject.url] === undefined) {