Load page script after body created (#1802)
document.body must exist by the time the top level Svelte component initializes. https://forums.ankiweb.net/t/2-1-50-editor-wont-show-when-addons-load-many-js-files/19036
This commit is contained in:
parent
a7cb5e210e
commit
adbe96ca00
@ -499,7 +499,7 @@ html {{ {font} }}
|
||||
|
||||
from aqt import mw
|
||||
|
||||
head = mw.baseHTML() + csstxt + jstxt + web_content.head
|
||||
head = mw.baseHTML() + csstxt + web_content.head
|
||||
body_class = theme_manager.body_class()
|
||||
|
||||
if theme_manager.night_mode:
|
||||
@ -520,7 +520,9 @@ html {{ {font} }}
|
||||
{head}
|
||||
</head>
|
||||
|
||||
<body class="{body_class}">{web_content.body}</body>
|
||||
<body class="{body_class}">
|
||||
{jstxt}
|
||||
{web_content.body}</body>
|
||||
</html>"""
|
||||
# print(html)
|
||||
self.setHtml(html)
|
||||
|
@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" id="viewport" content="width=device-width" />
|
||||
<link href="{PAGE}.css" rel="stylesheet" />
|
||||
<script src="{PAGE}.js"></script>
|
||||
<script src="{PAGE}.js" defer></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user