use template element for badge template

This commit is contained in:
2025-12-15 19:34:16 +03:00
parent b2d16e305d
commit c655caab9e
7 changed files with 13 additions and 19 deletions

View File

@@ -287,11 +287,8 @@ export class BadgeEditorForm {
return;
}
if (this.#badgeTemplate === undefined){
const badge = await this.api.getHTML(`${badgeEditorEndpoint}/template`)
if (!badge.value){
return;
}
this.#badgeTemplate= badge.value;
this.#badgeTemplate = document.getElementById('badge-editor-template').content;
console.log(this.#badgeTemplate);
}
el.replaceChildren();
const addButton = `<button data-disable-if-max="1" data-receive="updateBadgeCount" DISABLE_IF_MAX type="button" data-send="addBadge">Add badge</button>`;