limit characters soustitre
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -287,3 +287,17 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
// }
|
||||
// });
|
||||
|
||||
// ////////////////// start tronquage sous titre //////////////////
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const maxLength = 80;
|
||||
|
||||
document.querySelectorAll('.view-base-de-donnees .wrapper-ressource .field--name-field-sous-titre').forEach(function (element) {
|
||||
const fullText = element.textContent.trim();
|
||||
|
||||
if (fullText.length > maxLength) {
|
||||
const truncated = fullText.slice(0, maxLength).trim() + '...';
|
||||
element.textContent = truncated;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user