dialog for types on a button

New button for the zone Types dialog.
This commit is contained in:
Ángel Montero Lamas 2022-01-22 15:21:43 +01:00
parent d3e845413f
commit a49376480d
2 changed files with 7 additions and 5 deletions

View file

@ -2916,7 +2916,7 @@
<div id="zonesFilters">
<span>Filter by type: </span>
<select id="zonesFilterType" data-tip="Only zones of this type appear on the map"></select>
<button id="zonesFilterButton" data-tip="Click to toggle the filtering of elements on the list" class="icon-eye"></button>
<button id="zonesFilterButton" data-tip="Click to toggle the filtering of elements on the list" class="icon-resize-small"></button>
</div>
<div id="zonesFooter" class="totalLine">
@ -2944,6 +2944,7 @@
</div>
<button id="zonesAdd" data-tip="Add new zone layers or types" class="icon-plus"></button>
<button id="zonesEditTypes" data-tip="Add and edit zone types" class="icon-edit"></button>
<button id="zonesExport" data-tip="Download zones-related data" class="icon-download"></button>
</div>
</div>
@ -2961,7 +2962,6 @@
</div>
<div id="zonesTypesBottom">
<button id="zonesNewBlank" data-tip="Add a new blank zone layer" class="icon-flag-empty"></button>
<input type="text" id="zonesNewTypeInput" data-tip="Write the name of the type you want to add" maxlength="20" placeholder="Add type"></input>
<input type="button" id="zonesNewTypeButton" data-tip="Click add to save the type" value="Add">
</div>

View file

@ -27,8 +27,8 @@ function editZones() {
document.getElementById("zonesManually").addEventListener("click", enterZonesManualAssignent);
document.getElementById("zonesManuallyApply").addEventListener("click", applyZonesManualAssignent);
document.getElementById("zonesManuallyCancel").addEventListener("click", cancelZonesManualAssignent);
document.getElementById("zonesAdd").addEventListener("click", addZonesDialog);
document.getElementById("zonesNewBlank").addEventListener("click", addZonesLayer);
document.getElementById("zonesAdd").addEventListener("click", addZonesLayer);
document.getElementById("zonesEditTypes").addEventListener("click", addZonesDialog);
document.getElementById("zonesNewTypeButton").addEventListener("click", addZonesType);
document.getElementById("zonesExport").addEventListener("click", downloadZonesData);
document.getElementById("zonesRemove").addEventListener("click", toggleEraseMode);
@ -149,6 +149,8 @@ function editZones() {
});
body.innerHTML = lines;
if (body.innerHTML === "") { body.innerHTML = `<div class="states"><span>Zero entries for this type. To see entries again, select "All" or disable the filter button</span>
</div>`; }
for (let i=0; i<zoneCount; i++) {
let d = document.getElementById("zoneTypeZoneIdzone" + i);
@ -536,7 +538,7 @@ function editZones() {
let count=0; // Amount of zones per type
zones.selectAll("g").each(function() { if (this.dataset.type === z) count++; });
lines += `<div class="states"><span class="religionDeity">${z}</span><span class="religionType">${count}</span>`;
lines += `<div class="states"><span class="religionDeity">${z}</span><span class="statePopulation">${count}</span>`;
if (i > 5) {
let id="removeZoneType" + i;
lines += `<span data-tip="Remove zone type" class="icon-trash-empty" id="${id}"></span>`;