v1.5.64 - don't show Emblems header if not required

This commit is contained in:
Azgaar 2021-02-26 13:38:12 +03:00
parent b62e57f5a7
commit bc149bc65f

View file

@ -61,7 +61,7 @@ function editCultures() {
let lines = "", totalArea = 0, totalPopulation = 0; let lines = "", totalArea = 0, totalPopulation = 0;
const emblemShapeGroup = document.getElementById("emblemShape").selectedOptions[0].parentNode.label; const emblemShapeGroup = document.getElementById("emblemShape").selectedOptions[0].parentNode.label;
const selectShape = emblemShapeGroup === "Diversiform" const selectShape = emblemShapeGroup === "Diversiform";
for (const c of pack.cultures) { for (const c of pack.cultures) {
if (c.removed) continue; if (c.removed) continue;
@ -138,6 +138,8 @@ function editCultures() {
body.querySelectorAll("div > span.icon-arrows-cw").forEach(el => el.addEventListener("click", cultureRegenerateBurgs)); body.querySelectorAll("div > span.icon-arrows-cw").forEach(el => el.addEventListener("click", cultureRegenerateBurgs));
body.querySelectorAll("div > span.icon-trash-empty").forEach(el => el.addEventListener("click", cultureRemove)); body.querySelectorAll("div > span.icon-trash-empty").forEach(el => el.addEventListener("click", cultureRemove));
culturesHeader.querySelector("div[data-sortby='emblems']").style.display = selectShape ? "inline-block" : "none";
if (body.dataset.type === "percentage") {body.dataset.type = "absolute"; togglePercentageMode();} if (body.dataset.type === "percentage") {body.dataset.type = "absolute"; togglePercentageMode();}
applySorting(culturesHeader); applySorting(culturesHeader);
$("#culturesEditor").dialog({width: fitContent()}); $("#culturesEditor").dialog({width: fitContent()});