auto change font size to small if text is too long

main
alexanderroese 2024-08-13 11:31:42 +02:00
parent 9f736816f2
commit 96f479f06a
1 changed files with 13 additions and 8 deletions

View File

@ -1014,6 +1014,12 @@
document.querySelector('#shx-fontSize').value = 'Klein #small';
document.querySelector('#shx-fontSize').dispatchEvent(new Event('change'));
document.querySelector('#shx-info-text').style.display = 'block';
setTimeout(() => {
document.querySelector('#shx-info-text').style.display = 'none';
}, 5000);
}
}
@ -1134,19 +1140,18 @@
this.Viewer3DContainer.appendChild(this.invisibleProductID);
}
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.infoText.id = 'shx-info-text';
this.infoText.style.display = 'none';
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);
}
setTimeout(createIFrame.bind(this), 1000);
}
initCurrentVariant(id) {
this.currentVariant = id;