From 6d750402cf3835f4da9ee16006bc55ae46d086e2 Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Tue, 13 Aug 2024 10:44:06 +0200 Subject: [PATCH] auto change font size to small if text is too long --- snippets/shx-3d-render-input.liquid | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index 011b865..31f4810 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -1007,6 +1007,15 @@ this.disableBuyButton(); console.log("text too long, selectect font size", document.querySelector('#shx-fontSize').value); + + // if font size is not small, set it to small + + if(document.querySelector('#shx-fontSize').value !== 'Klein #small') { + alert("Text ist zu lang. Wir haben die Schriftgröße auf klein gesetzt. Bitte überprüfe deinen Text."); + + document.querySelector('#shx-fontSize').value = 'Klein #small'; + document.querySelector('#shx-fontSize').dispatchEvent(new Event('change')); + } } hideLoadingSpinner() {