outposts: load token async
This commit is contained in:
@ -7,6 +7,7 @@ document.querySelectorAll("button.pf-c-dropdown__toggle").forEach((b) => {
|
||||
});
|
||||
});
|
||||
|
||||
// Search clearing
|
||||
document.querySelectorAll("input[type=search]").forEach((si) => {
|
||||
si.addEventListener("search", (e) => {
|
||||
if (si.value === "") {
|
||||
@ -15,6 +16,16 @@ document.querySelectorAll("input[type=search]").forEach((si) => {
|
||||
});
|
||||
});
|
||||
|
||||
// Fetch from data-attributes
|
||||
document.querySelectorAll("[data-pb-fetch-fill]").forEach((el) => {
|
||||
const url = el.dataset.pbFetchFill;
|
||||
const key = el.dataset.pbFetchKey;
|
||||
fetch(url).then(r => r.json()).then(r => {
|
||||
el.textContent = r[key];
|
||||
el.value = r[key];
|
||||
});
|
||||
});
|
||||
|
||||
// Modal
|
||||
document.querySelectorAll("[data-target='modal']").forEach((m) => {
|
||||
m.addEventListener("click", (e) => {
|
||||
|
||||
Reference in New Issue
Block a user