mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
added UI for burg group filter
- Code for filtering burgs. - Added new pop up menu when clicking the button "reassign burgs".
This commit is contained in:
parent
9c206a3813
commit
64bc701809
4 changed files with 151 additions and 30 deletions
|
|
@ -98,14 +98,10 @@ function editBurg(id) {
|
|||
|
||||
// select group
|
||||
const group = elSelected.node().parentNode.id;
|
||||
const select = byId("burgSelectGroup");
|
||||
select.options.length = 0; // remove all options
|
||||
|
||||
burgLabels.selectAll("g").each(function () {
|
||||
select.options.add(new Option(this.id, this.id, false, this.id === group));
|
||||
});
|
||||
updateBurgsGroupFilter("burgSelectGroup", group);
|
||||
|
||||
// set emlem image
|
||||
// set emblem image
|
||||
const coaID = "burgCOA" + id;
|
||||
COArenderer.trigger(coaID, b.coa);
|
||||
byId("burgEmblem").setAttribute("href", "#" + coaID);
|
||||
|
|
@ -144,6 +140,15 @@ function editBurg(id) {
|
|||
byId("burgSelectGroup").style.display = "inline-block";
|
||||
}
|
||||
|
||||
function updateBurgsGroupFilter(id, alreadySelectedGroup) {
|
||||
const select = document.getElementById(id);
|
||||
select.options.length = 0; // remove all options
|
||||
|
||||
burgLabels.selectAll("g").each(function () {
|
||||
select.options.add(new Option(this.id, this.id, false, this.id === alreadySelectedGroup));
|
||||
});
|
||||
}
|
||||
|
||||
function changeGroup() {
|
||||
const id = +elSelected.attr("data-id");
|
||||
moveBurgToGroup(id, this.value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue