This commit is contained in:
2025-01-31 18:08:53 +01:00
parent 5ad94078ed
commit f34bbe0602
36 changed files with 424 additions and 30 deletions

View File

@@ -16,6 +16,7 @@ class BrickSetSocket extends BrickSocket {
this.html_input = document.getElementById(`${id}-set`);
this.html_no_confim = document.getElementById(`${id}-no-confirm`);
this.html_owners = document.getElementById(`${id}-owners`);
this.html_tags = document.getElementById(`${id}-tags`);
// Card elements
this.html_card = document.getElementById(`${id}-card`);
@@ -150,11 +151,22 @@ class BrickSetSocket extends BrickSocket {
});
}
// Grab the tags
const tags = [];
if (this.html_tags) {
this.html_tags.querySelectorAll('input').forEach(input => {
if (input.checked) {
tags.push(input.value);
}
});
}
this.spinner(true);
this.socket.emit(this.messages.IMPORT_SET, {
set: (set !== undefined) ? set : this.html_input.value,
owners: owners,
tags: tags,
refresh: this.refresh
});
} else {
@@ -267,6 +279,10 @@ class BrickSetSocket extends BrickSocket {
this.html_owners.querySelectorAll('input').forEach(input => input.disabled = !enabled);
}
if (this.html_tags) {
this.html_tags.querySelectorAll('input').forEach(input => input.disabled = !enabled);
}
if (this.html_card_confirm) {
this.html_card_confirm.disabled = !enabled;
}