mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
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
2 changed files with 5 additions and 3 deletions
|
@ -499,7 +499,7 @@ html {{ {font} }}
|
||||||
|
|
||||||
from aqt import mw
|
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()
|
body_class = theme_manager.body_class()
|
||||||
|
|
||||||
if theme_manager.night_mode:
|
if theme_manager.night_mode:
|
||||||
|
@ -520,7 +520,9 @@ html {{ {font} }}
|
||||||
{head}
|
{head}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="{body_class}">{web_content.body}</body>
|
<body class="{body_class}">
|
||||||
|
{jstxt}
|
||||||
|
{web_content.body}</body>
|
||||||
</html>"""
|
</html>"""
|
||||||
# print(html)
|
# print(html)
|
||||||
self.setHtml(html)
|
self.setHtml(html)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" id="viewport" content="width=device-width" />
|
<meta name="viewport" id="viewport" content="width=device-width" />
|
||||||
<link href="{PAGE}.css" rel="stylesheet" />
|
<link href="{PAGE}.css" rel="stylesheet" />
|
||||||
<script src="{PAGE}.js"></script>
|
<script src="{PAGE}.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
<body></body>
|
<body></body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue