From e2f9c16ce3a5aabf9128dbf878bb5ef0ad77c041 Mon Sep 17 00:00:00 2001 From: Jan Umbach Date: Sat, 22 Jun 2024 10:07:30 +0200 Subject: [PATCH] shx-3d-render --- snippets/shx-3d-render-input.liquid | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index e259eb9..6ee9a37 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -403,6 +403,15 @@ } renderView() { + let currentTimeout = this.renderViewDebounce; + if(currentTimeout) { + clearTimeout(currentTimeout); + } + + this.renderViewDebounce = setTimeout(this._renderView.bind(this), 500); + } + + _renderView() { // request data from server let tJS = this.tJS; @@ -451,19 +460,7 @@ if(this.Viewer3D) this.Viewer3D.contentWindow.postMessage(JSON.stringify({"changeView":{"currentVariant": this.currentVariant, values: globalInputFormsObjValues[this.currentVariant]}}), "*"); - this.loadingSpinner.show(); - - - - /*fetch('https://render.shinnex.de/render/' + this.currentVariant, { method: 'POST', body: JSON.stringify(globalInputFormsObjValues[this.currentVariant]) }) - .then((response) => { - // stl file - return response.blob(); - }).then((blob) => { - // log size in kB - console.log(blob.size / 1024 + 'kB'); - - });*/ + this.loadingSpinner.show(); }