auto change font size to small if text is too long

main
alexanderroese 2024-08-13 11:40:15 +02:00
parent 96f479f06a
commit 29c62c5d97
1 changed files with 8 additions and 5 deletions

View File

@ -1005,21 +1005,24 @@
this.loadingSpinner.showErrorCharLottie("Hoppla, der von dir eingegebene Text ist zu lang. Bitte kürze ihn oder wende dich an uns für eine individuelle Lösung.");
this.disableBuyButton();
console.log("text too long, selectect font size", document.querySelector('#shx-fontSize').value);
{%comment %}
// if font size is not small, set it to small
// most users are not changing the font size, so we set it for them
// because they only want to generate the product and not to change the font size
// so with this we will keep the user flow and the user will not be confused
{% endcomment %}
if(document.querySelector('#shx-fontSize').value !== 'Klein #small') {
alert("Here3 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'));
// show info text that the text is too long and we set the font size to small
document.querySelector('#shx-info-text').style.display = 'block';
// hide the text after 5 seconds
setTimeout(() => {
document.querySelector('#shx-info-text').style.display = 'none';
}, 5000);
}, 10000);
}
}