minor: contact implementation

This commit is contained in:
Jean-Baptiste Pasquier
2020-12-09 12:20:35 +01:00
parent f68cd98964
commit 5b15093372
8 changed files with 93 additions and 71 deletions

View File

@ -187,10 +187,14 @@ document.addEventListener("DOMContentLoaded", () => {
*/
function recursivePopulate(element) {
Array.from(element.querySelectorAll('*')).forEach((e) => {
e.addEventListener("populate", (e) => {
recursivePopulate(e.target);
jsI18n.processNode(e.target);
});
if(e.content && e.content instanceof DocumentFragment) {
recursivePopulate(e.content);
} else if(e instanceof HTMLElement) {
e.addEventListener("populate", (el) => {
recursivePopulate(el.target);
jsI18n.processNode(el.target);
});
}
});
}
// Process every children from document