shx-3d-render

main
Jan Umbach 2024-06-19 21:08:28 +02:00
parent 002e0b4118
commit 15e4bdabf5
1 changed files with 8 additions and 5 deletions

View File

@ -163,7 +163,13 @@
return; return;
} }
if(data.id !== this.uuid) return; if(data.id !== this.uuid) {
if(status === "init" ) {
Viewer3D.contentWindow.postMessage(JSON.stringify({"init":{"uuid":this.uuid}}), "*");
this.Viewer3DContainer.querySelector('.shx-loading-spinner-container').classList.remove('shx-loading-spinner-container-done');
}
return;
};
console.log("Message received from the child: ", data); // Message received from child console.log("Message received from the child: ", data); // Message received from child
@ -200,10 +206,7 @@
function createIFrame() { function createIFrame() {
this.Viewer3D = document.createElement('iframe'); this.Viewer3D = document.createElement('iframe');
const Viewer3D = this.Viewer3D; const Viewer3D = this.Viewer3D;
this.Viewer3D.onload = () => {
Viewer3D.contentWindow.postMessage(JSON.stringify({"init":{"uuid":this.uuid}}), "*");
};
this.Viewer3D.src = "https://3d-viewer.shinnex.de/"; this.Viewer3D.src = "https://3d-viewer.shinnex.de/";
this.Viewer3D.classList.add('shx-threejs-renderer'); this.Viewer3D.classList.add('shx-threejs-renderer');