localization: don't recheck on DOMContentLoaded

This commit is contained in:
tophf 2017-04-09 08:10:25 +03:00
parent a889ac6413
commit 1ded89969b

View File

@ -73,14 +73,15 @@ function tDocLoader() {
tNodeList(document.all);
// localize BODY
const observer = new MutationObserver(mutations => {
const process = mutations => {
for (const mutation of mutations) {
tNodeList(mutation.addedNodes);
}
});
};
const observer = new MutationObserver(process);
const onLoad = () => {
tDocLoader.stop();
tNodeList(document.all);
process(observer.takeRecords());
};
tDocLoader.start = () => {
observer.observe(document, {subtree: true, childList: true});