lock burg - values is boolean, not 1/0

This commit is contained in:
Azgaar 2022-01-01 19:09:50 +03:00
parent 18acadfd80
commit a55e8d96ff
3 changed files with 8 additions and 8 deletions

View file

@ -362,7 +362,9 @@ function editBurg(id) {
function toggleBurgLockButton() { function toggleBurgLockButton() {
const id = +elSelected.attr("data-id"); const id = +elSelected.attr("data-id");
toggleBurgLock(id); const burg = pack.burgs[id];
burg.lock = !burg.lock;
updateBurgLockIcon(); updateBurgLockIcon();
} }

View file

@ -197,8 +197,11 @@ function overviewBurgs() {
} }
function toggleBurgLockStatus() { function toggleBurgLockStatus() {
const burg = +this.parentNode.dataset.id; const burgId = +this.parentNode.dataset.id;
toggleBurgLock(burg);
const burg = pack.burgs[burgId];
burg.lock = !burg.lock;
if (this.classList.contains("icon-lock")) { if (this.classList.contains("icon-lock")) {
this.classList.remove("icon-lock"); this.classList.remove("icon-lock");
this.classList.add("icon-lock-open"); this.classList.add("icon-lock-open");

View file

@ -297,11 +297,6 @@ function getMFCGlink(burg) {
return url; return url;
} }
function toggleBurgLock(burg) {
const b = pack.burgs[burg];
b.lock = b.lock ? 0 : 1;
}
// draw legend box // draw legend box
function drawLegend(name, data) { function drawLegend(name, data) {
legend.selectAll("*").remove(); // fully redraw every time legend.selectAll("*").remove(); // fully redraw every time