Telegram: Allow admin to add telegram contact

Works in the same way as on the form, but can now be done in the
accounts tab.
This commit is contained in:
Harvey Tindall
2021-05-07 18:20:35 +01:00
parent 0f41d1e6cf
commit 2d93b3b7ee
13 changed files with 229 additions and 12 deletions
+19
View File
@@ -179,3 +179,22 @@ export function toggleLoader(el: HTMLElement, small: boolean = true) {
el.appendChild(dot);
}
}
export function addLoader(el: HTMLElement, small: boolean = true) {
if (!el.classList.contains("loader")) {
el.classList.add("loader");
if (small) { el.classList.add("loader-sm"); }
const dot = document.createElement("span") as HTMLSpanElement;
dot.classList.add("dot")
el.appendChild(dot);
}
}
export function removeLoader(el: HTMLElement, small: boolean = true) {
if (el.classList.contains("loader")) {
el.classList.remove("loader");
el.classList.remove("loader-sm");
const dot = el.querySelector("span.dot");
if (dot) { dot.remove(); }
}
}