1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-13 18:16:19 +02:00

code cleaning

This commit is contained in:
Kushagra Gour
2017-06-26 16:23:20 +05:30
parent 569626223e
commit dbf2d33b4c
2 changed files with 2 additions and 5 deletions

View File

@ -1411,14 +1411,11 @@ runBtn, searchInput, consoleEl, consoleLogEl, logCountEl, fontStyleTag, fontStyl
// Compile d-html directive
const dHtmlNodes = $all(`[d-html]`);
dHtmlNodes.forEach(function (el) {
console.log(Date.now())
fetch(el.getAttribute('d-html')).then((response) => {
// Stop further compilation because of future recursion by removing attribute.
el.removeAttribute('d-html');
response.text().then((html) => {
console.log(Date.now())
requestIdleCallback(() => {
console.log(Date.now())
el.innerHTML = html;
})
})