diff --git a/index.css b/index.css index 08e5d07e..4a7a1dd0 100644 --- a/index.css +++ b/index.css @@ -1242,7 +1242,7 @@ div.states>.religionForm { width: 6em; } -div.states>.religionDeidy { +div.states>.religionDeity { width: 15em; } diff --git a/modules/ui/religions-editor.js b/modules/ui/religions-editor.js index d07c0eeb..709ab165 100644 --- a/modules/ui/religions-editor.js +++ b/modules/ui/religions-editor.js @@ -72,7 +72,7 @@ function editReligions() { - +
${si(area) + unit}
@@ -87,7 +87,7 @@ function editReligions() { - +
${si(area) + unit}
@@ -112,6 +112,7 @@ function editReligions() { body.querySelectorAll("div > input.religionName").forEach(el => el.addEventListener("input", religionChangeName)); body.querySelectorAll("div > select.religionType").forEach(el => el.addEventListener("input", religionChangeType)); body.querySelectorAll("div > input.religionForm").forEach(el => el.addEventListener("input", religionChangeForm)); + body.querySelectorAll("div > input.religionDeity").forEach(el => el.addEventListener("input", religionChangeDeity)); body.querySelectorAll("div > span.icon-arrows-cw").forEach(el => el.addEventListener("click", regenerateDeity)); body.querySelectorAll("div > span.icon-trash-empty").forEach(el => el.addEventListener("click", religionRemove)); @@ -175,6 +176,12 @@ function editReligions() { pack.religions[religion].form = this.value; } + function religionChangeDeity() { + const religion = +this.parentNode.dataset.id; + this.parentNode.dataset.deity = this.value; + pack.religions[religion].deity = this.value; + } + function regenerateDeity() { const religion = +this.parentNode.dataset.id; const culture = pack.religions[religion].culture;