stable, before a refactor

This commit is contained in:
Jason Jordan
2026-03-03 22:53:21 -05:00
parent 4fac3b1036
commit 942d60c3e0
66 changed files with 1321 additions and 194 deletions
@@ -4,6 +4,7 @@ export default class extends Controller {
static targets = ["preview", "previewContainer", "logoSelect", "logofield", "initialLogoFile"];
async connect() {
console.log('in connect');
console.log(this.logofieldTarget.value)
if (this.logofieldTarget.value.includes("Logo.")) {
const response = await fetch(`/card_logo_files/${this.logofieldTarget.value}/image`); // Fetch the binary data
@@ -82,13 +83,13 @@ export default class extends Controller {
const blankOptionIndex = 0;
const newOption = new Option(name, name, true, true)
if (this.logoSelectTarget.options.length > blankOptionIndex + 1) {
this.logoSelectTarget.insertBefore(newOption, this.logoSelectTarget.options[blankOptionIndex + 1]);
if (this.logofieldTarget.options.length > blankOptionIndex + 1) {
this.logofieldTarget.insertBefore(newOption, this.logofieldTarget.options[blankOptionIndex + 1]);
} else {
this.logoSelectTarget.appendChild(newOption);
this.logofieldTarget.appendChild(newOption);
}
this.logoSelectTarget.value = name;
this.logofieldTarget.value = name;
}
determineNetworkFilename(file) {