|
@@ -272,4 +272,18 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
});
|
|
|
|
|
|
|
|
|
+////////////////// start tronquage sous titre //////////////////
|
|
|
+document.addEventListener("DOMContentLoaded", function () {
|
|
|
+ const maxLength = 20; // <-- modifiez cette valeur si besoin
|
|
|
+ const field = document.querySelector(".field--name-field-sous-titre a");
|
|
|
+
|
|
|
+ if (field) {
|
|
|
+ const fullText = field.textContent.trim();
|
|
|
+ if (fullText.length > maxLength) {
|
|
|
+ const truncated = fullText.slice(0, maxLength).trim() + "...";
|
|
|
+ field.textContent = truncated;
|
|
|
+ field.setAttribute("title", fullText); // Affiche le texte complet au survol
|
|
|
+ }
|
|
|
+ }
|
|
|
+});
|
|
|
|