auto change font size to small if text is too long

main
alexanderroese 2024-08-13 11:45:04 +02:00
parent c585dd8d63
commit bbd5e5d33f
1 changed files with 3 additions and 2 deletions

View File

@ -1019,10 +1019,10 @@
// show info text that the text is too long and we set the font size to small // 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'; document.querySelector('#shx-info-text').style.display = 'block';
// hide the text after 5 seconds // hide the text after 8 seconds
this.infoTextTimeout = setTimeout(() => { this.infoTextTimeout = setTimeout(() => {
document.querySelector('#shx-info-text').style.display = 'none'; document.querySelector('#shx-info-text').style.display = 'none';
}, 5000); }, 8000);
} }
} }
@ -1148,6 +1148,7 @@
this.infoText = document.createElement('span'); this.infoText = document.createElement('span');
this.infoText.id = 'shx-info-text'; this.infoText.id = 'shx-info-text';
this.infoText.style.display = 'none'; this.infoText.style.display = 'none';
this.infoText.style.color = 'red';
this.infoText.innerText = 'Text ist zu lang. Wir haben die Schriftgröße auf klein gesetzt. Bitte überprüfe deinen Text.'; this.infoText.innerText = 'Text ist zu lang. Wir haben die Schriftgröße auf klein gesetzt. Bitte überprüfe deinen Text.';
this.container.appendChild(this.infoText); this.container.appendChild(this.infoText);
} }