From 8b57426dc8d1da2df35cfcc53aa7d25a7b3aa36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Montero=20Lamas?= Date: Tue, 16 Jan 2024 19:30:17 +0100 Subject: [PATCH] deleting totalCells in the code, maybe i will add provinceCells in the future. Deleted lines for const totalCells and for (+cells / totalCells) * 100 + "%"; --- modules/ui/provinces-editor.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/ui/provinces-editor.js b/modules/ui/provinces-editor.js index 08e5fbea..7ca02fdb 100644 --- a/modules/ui/provinces-editor.js +++ b/modules/ui/provinces-editor.js @@ -584,14 +584,12 @@ function editProvinces() { function togglePercentageMode() { if (body.dataset.type === "absolute") { body.dataset.type = "percentage"; - const totalCells = +byId("statesFooterCells").innerText; const totalBurgs = +byId("provincesFooterBurgs").innerText; const totalArea = +provincesFooterArea.dataset.area; const totalPopulation = +provincesFooterPopulation.dataset.population; body.querySelectorAll(":scope > div").forEach(function (el) { const {cells, burgs, area, population} = el.dataset; - el.querySelector(".provinceCells").innerText = rn((+cells / totalCells) * 100) + "%"; el.querySelector(".provinceBurgs").innerText = rn((+burgs / totalBurgs) * 100) + "%"; el.querySelector(".biomeArea").innerHTML = rn((+area / totalArea) * 100) + "%"; el.querySelector(".culturePopulation").innerHTML = rn((+population / totalPopulation) * 100) + "%";