shx-3d-render

main
Jan Umbach 2024-06-19 22:39:59 +02:00
parent c75bff104e
commit 3848936f4b
1 changed files with 7 additions and 4 deletions

View File

@ -170,7 +170,8 @@
const initData = JSON.stringify({"init":{"uuid":uuid}}); const initData = JSON.stringify({"init":{"uuid":uuid}});
console.log("initData", initData ); console.log("initData", initData );
this.Viewer3D.contentWindow.postMessage(initData, "*"); this.Viewer3D.contentWindow.postMessage(initData, "*");
this.Viewer3DContainer.querySelector('.shx-loading-spinner-container').classList.remove('shx-loading-spinner-container-done');
this.loadingSpinner.show();
} }
return; return;
}; };
@ -178,9 +179,9 @@
console.log("Message received from the child: ", data); // Message received from child console.log("Message received from the child: ", data); // Message received from child
if(data.loaded === true) { if(data.loaded === true) {
this.Viewer3DContainer.querySelector('.shx-loading-spinner-container').classList.add('shx-loading-spinner-container-done'); this.loadingSpinner.hide();
} else { } else {
this.Viewer3DContainer.querySelector('.shx-loading-spinner-container').classList.remove('shx-loading-spinner-container-done'); this.loadingSpinner.show();
} }
} }
@ -204,6 +205,7 @@
this.Viewer3DContainer = document.createElement('div'); this.Viewer3DContainer = document.createElement('div');
this.Viewer3DContainer.classList.add('shx-threejs-renderer-container'); this.Viewer3DContainer.classList.add('shx-threejs-renderer-container');
this.Viewer3DContainer.innerHTML = `{% render 'shx-loading-spinner', content_type:"body" %}`; this.Viewer3DContainer.innerHTML = `{% render 'shx-loading-spinner', content_type:"body" %}`;
this.loadingSpinner = this.Viewer3DContainer.querySelector('shx-loading-spinner');
this.container.appendChild(this.Viewer3DContainer); this.container.appendChild(this.Viewer3DContainer);
@ -269,7 +271,8 @@
if(this.Viewer3D) if(this.Viewer3D)
this.Viewer3D.contentWindow.postMessage(JSON.stringify({"changeView":{"currentVariant": this.currentVariant, values: globalInputFormsObjValues[this.currentVariant]}}), "*"); this.Viewer3D.contentWindow.postMessage(JSON.stringify({"changeView":{"currentVariant": this.currentVariant, values: globalInputFormsObjValues[this.currentVariant]}}), "*");
this.Viewer3DContainer.querySelector('.shx-loading-spinner-container').classList.remove('shx-loading-spinner-container-done');
this.loadingSpinner.show();