From 9f736816f25ee4aebc2bc1bd83d230bcf1e40d68 Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Tue, 13 Aug 2024 11:21:35 +0200 Subject: [PATCH] auto change font size to small if text is too long --- snippets/shx-3d-render-input.liquid | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index 772e743..c95a64f 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -1134,15 +1134,17 @@ this.Viewer3DContainer.appendChild(this.invisibleProductID); - // create text below the iframe for information if the text is too long and we set the font size to small - - this.infoText = document.createElement('span'); - this.infoText.innerText = 'Here1 Text ist zu lang. Wir haben die Schriftgröße auf klein gesetzt. Bitte überprüfe deinen Text.'; -/* this.infoText.classList.add('shx-info-text'); */ - this.Viewer3DContainer.appendChild(this.infoText); + } setTimeout(createIFrame.bind(this), 1000); + + // create text below the iframe for information if the text is too long and we set the font size to small + + this.infoText = document.createElement('span'); + this.infoText.innerText = 'Here1 Text ist zu lang. Wir haben die Schriftgröße auf klein gesetzt. Bitte überprüfe deinen Text.'; + /* this.infoText.classList.add('shx-info-text'); */ + this.container.appendChild(this.infoText); } initCurrentVariant(id) {