Fix bug with js for archived accounts

This commit is contained in:
Edgar P. Burkhart 2025-01-02 17:33:25 +01:00
parent 224f55a8b1
commit 57b315c842
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
4 changed files with 10 additions and 11 deletions

View file

@ -4,7 +4,6 @@
{{ block.super }}
{% css "main/css/table.css" %}
{% css "main/css/plot.css" %}
{% js "main/js/index.js" %}
{% endblock link %}
{% block name %}
{% translate "Account" %}

View file

@ -56,3 +56,13 @@ for (let form of forms) {
});
}
}
let accounts = document.querySelector("dl.accounts");
let toggle = accounts.querySelector("input#show-archived-accounts");
if (toggle) {
accounts.classList.toggle("show-archive", toggle.checked);
toggle.addEventListener("change", (event) => {
accounts.classList.toggle("show-archive", toggle.checked);
});
}

View file

@ -1,9 +0,0 @@
let accounts = document.querySelector("dl.accounts");
let toggle = accounts.querySelector("input#show-archived-accounts");
accounts.classList.toggle("show-archive", toggle.checked);
if (toggle) {
toggle.addEventListener("change", (event) => {
accounts.classList.toggle("show-archive", toggle.checked);
});
}

View file

@ -6,7 +6,6 @@
{{ block.super }}
{% css "main/css/table.css" %}
{% css "main/css/plot.css" %}
{% js "main/js/index.js" %}
{% endblock link %}
{% block body %}
<div class="split">