1
0
Fork 0

make use of templates instead of hidden divs which is more elegant

This commit is contained in:
Vivianne Langdon 2022-11-26 12:14:48 -08:00
parent 8ec984c3ff
commit c4398ff187
2 changed files with 48 additions and 51 deletions

View file

@ -628,9 +628,8 @@ let BookWyrm = new (class {
}
function toggleStatus(status) {
for (const child of statusNode.children) {
BookWyrm.toggleContainer(child, !child.classList.contains(status));
}
const template = document.querySelector(`#barcode-${status}`);
statusNode.replaceChildren(template ? template.content.cloneNode(true) : null);
}
function initBarcodes(cameraId = null) {