1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-09 17:45:02 +09:00

fix embeds

This commit is contained in:
Andrew Simachev 2023-12-08 22:36:10 +01:00
parent 12b688273f
commit c0efc3d936
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
2 changed files with 5 additions and 6 deletions

View file

@ -15,7 +15,6 @@
<body>
<script type="text/javascript">
let cachedHtml = '';
let path = '';
window.addEventListener('message', e => {
if (!e.origin.match(/\/\/localhost:/) && (e.origin !== 'file://')) {
@ -26,7 +25,7 @@
const body = document.body;
const { html, js, theme, libs } = e.data;
loadLibs(path, libs, () => {
loadLibs(libs, () => {
if (cachedHtml !== html) {
body.innerHTML = html;
cachedHtml = html;
@ -56,7 +55,7 @@
window.parent.postMessage({ height: document.documentElement.scrollHeight }, '*');
};
function loadLibs (path, list, callBack) {
function loadLibs (list, callBack) {
if (!list.length) {
if (callBack) {
callBack();
@ -71,7 +70,7 @@
script.onload = function (e) {
if (list.length) {
loadLibs(path, list, callBack);
loadLibs(list, callBack);
} else
if (callBack) {
callBack();
@ -79,7 +78,7 @@
};
script.type = 'text/javascript';
script.src = path + src;
script.src = src;
};
</script>
</body>