Merge branch 'master' into dev

This commit is contained in:
Azgaar 2020-04-01 20:56:41 +03:00 committed by GitHub
commit 4054391fc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -2839,7 +2839,7 @@
<div style="left:12.4em" data-tip="Click to sort by diplomatical relations" class="sortable alphabetically" data-sortby="relations">Relations&nbsp;</div>
</div>
<div id="diplomacyBodySection" class="table"></div>
<div id="diplomacyBodySection" class="table"></div>
<div id="diplomacySelect">
<div data-tip="Ally means states formed a defensive pact and will protect each other in case of third party aggression">Ally</div>

View file

@ -207,6 +207,15 @@ function editStates() {
}
function editStateName(state) {
//Reset input value and close add mode
stateNameEditorCustomForm.value = "";
const addModeActive = stateNameEditorCustomForm.style.display === "inline-block";
if (addModeActive) {
stateNameEditorCustomForm.style.display = "none";
stateNameEditorSelectForm.style.display = "inline-block";
}
const s = pack.states[state];
document.getElementById("stateNameEditor").dataset.state = state;
document.getElementById("stateNameEditorShort").value = s.name || "";
@ -244,10 +253,11 @@ function editStates() {
function addCustomForm() {
const value = stateNameEditorCustomForm.value;
const displayed = stateNameEditorCustomForm.style.display === "inline-block";
stateNameEditorCustomForm.style.display = displayed ? "none" : "inline-block";
stateNameEditorSelectForm.style.display = displayed ? "inline-block" : "none";
if (displayed) applyOption(stateNameEditorSelectForm, value);
const addModeActive = stateNameEditorCustomForm.style.display === "inline-block";
stateNameEditorCustomForm.style.display = addModeActive ? "none" : "inline-block";
stateNameEditorSelectForm.style.display = addModeActive ? "inline-block" : "none";
if (addModeActive) applyOption(stateNameEditorSelectForm, value);
stateNameEditorCustomForm.value = "";
}
function regenerateFullName() {