off-by-1 + await
This commit is contained in:
parent
a76d5e9d6c
commit
ea04b14749
|
@ -38,7 +38,7 @@ input:disabled + span {
|
||||||
#header {
|
#header {
|
||||||
--child-gap: 1rem;
|
--child-gap: 1rem;
|
||||||
}
|
}
|
||||||
#header-contents > :nth-last-child(n + 3) {
|
#header-contents > :nth-last-child(n + 2) {
|
||||||
margin-bottom: var(--child-gap);
|
margin-bottom: var(--child-gap);
|
||||||
}
|
}
|
||||||
#header.meta-init-error {
|
#header.meta-init-error {
|
||||||
|
|
|
@ -120,12 +120,13 @@ Object.assign(t, {
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetchTemplate(url, name) {
|
async fetchTemplate(url, name) {
|
||||||
return t.template[name] || download(url, {responseType: 'document'}).then(doc => {
|
let el = t.template[name];
|
||||||
const el = doc.body.firstElementChild;
|
if (!el) {
|
||||||
|
el = (await download(url, {responseType: 'document'})).body.firstElementChild;
|
||||||
t.NodeList(el.getElementsByTagName('*'));
|
t.NodeList(el.getElementsByTagName('*'));
|
||||||
t.template[name] = el;
|
t.template[name] = el;
|
||||||
return el;
|
}
|
||||||
});
|
return el;
|
||||||
},
|
},
|
||||||
|
|
||||||
sanitizeHtml(root) {
|
sanitizeHtml(root) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user