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:
parent
12b688273f
commit
c0efc3d936
2 changed files with 5 additions and 6 deletions
9
dist/embed/iframe.html
vendored
9
dist/embed/iframe.html
vendored
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue