Set purchase location

This commit is contained in:
2025-02-04 12:52:18 +01:00
parent e7bfa66512
commit 195f18f141
34 changed files with 427 additions and 48 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_purchase_location = document.getElementById(`${id}-purchase-location`);
this.html_storage = document.getElementById(`${id}-storage`);
this.html_tags = document.getElementById(`${id}-tags`);
@@ -152,6 +153,12 @@ class BrickSetSocket extends BrickSocket {
});
}
// Grab the purchase location
let purchase_location = null;
if (this.html_purchase_location) {
purchase_location = this.html_purchase_location.value;
}
// Grab the storage
let storage = null;
if (this.html_storage) {
@@ -177,6 +184,7 @@ class BrickSetSocket extends BrickSocket {
this.socket.emit(this.messages.IMPORT_SET, {
set: (set !== undefined) ? set : this.html_input.value,
owners: owners,
purchase_location: purchase_location,
storage: storage,
tags: tags,
refresh: this.refresh
@@ -293,6 +301,10 @@ class BrickSetSocket extends BrickSocket {
this.html_owners.querySelectorAll('input').forEach(input => input.disabled = !enabled);
}
if (this.html_purchase_location) {
this.html_purchase_location.disabled = !enabled;
}
if (this.html_storage) {
this.html_storage.disabled = !enabled;
}