From a55e8d96ff363feba41b747b508f7b5d137114fc Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 1 Jan 2022 19:09:50 +0300 Subject: [PATCH] lock burg - values is boolean, not 1/0 --- modules/ui/burg-editor.js | 4 +++- modules/ui/burgs-overview.js | 7 +++++-- modules/ui/editors.js | 5 ----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/ui/burg-editor.js b/modules/ui/burg-editor.js index 18e589df..24d0524a 100644 --- a/modules/ui/burg-editor.js +++ b/modules/ui/burg-editor.js @@ -362,7 +362,9 @@ function editBurg(id) { function toggleBurgLockButton() { const id = +elSelected.attr("data-id"); - toggleBurgLock(id); + const burg = pack.burgs[id]; + burg.lock = !burg.lock; + updateBurgLockIcon(); } diff --git a/modules/ui/burgs-overview.js b/modules/ui/burgs-overview.js index 14e2f959..684042cd 100644 --- a/modules/ui/burgs-overview.js +++ b/modules/ui/burgs-overview.js @@ -197,8 +197,11 @@ function overviewBurgs() { } function toggleBurgLockStatus() { - const burg = +this.parentNode.dataset.id; - toggleBurgLock(burg); + const burgId = +this.parentNode.dataset.id; + + const burg = pack.burgs[burgId]; + burg.lock = !burg.lock; + if (this.classList.contains("icon-lock")) { this.classList.remove("icon-lock"); this.classList.add("icon-lock-open"); diff --git a/modules/ui/editors.js b/modules/ui/editors.js index 5f648fa5..368339ad 100644 --- a/modules/ui/editors.js +++ b/modules/ui/editors.js @@ -297,11 +297,6 @@ function getMFCGlink(burg) { return url; } -function toggleBurgLock(burg) { - const b = pack.burgs[burg]; - b.lock = b.lock ? 0 : 1; -} - // draw legend box function drawLegend(name, data) { legend.selectAll("*").remove(); // fully redraw every time