fix style initialization

This commit is contained in:
Florian Dold 2017-04-27 02:31:32 +02:00
parent 3c563c78d4
commit 68e44e0e80
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -257,8 +257,15 @@ function init() {
return; return;
} }
if (document.documentElement.getAttribute("data-taler-nojs")) { if (document.documentElement.getAttribute("data-taler-nojs")) {
initStyle(); const onload = () => {
setStyles(true); initStyle();
setStyles(true);
};
if (document.readyState == "complete") {
onload();
} else {
document.addEventListener("DOMContentLoaded", onload);
}
} }
registerHandlers(); registerHandlers();
// Hack to know when the extension is unloaded // Hack to know when the extension is unloaded