浏览代码

limit carroussel à madia image

ouidade 1 月之前
父节点
当前提交
39c04b3245
共有 2 个文件被更改,包括 6 次插入18 次删除
  1. 0 0
      web/themes/custom/eql/dist/assets/bundle.js
  2. 6 18
      web/themes/custom/eql/scripts/main.js

文件差异内容过多而无法显示
+ 0 - 0
web/themes/custom/eql/dist/assets/bundle.js


+ 6 - 18
web/themes/custom/eql/scripts/main.js

@@ -183,8 +183,10 @@ jQuery(function ($) {
 
   }
 });
-/////////////////diaporama ressource //////////
+/////////////////start diaporama ressource //////////
 document.addEventListener('DOMContentLoaded', function () {
+    // Vérifie que le body a la classe souhaitée
+    if (!document.body.classList.contains('type-media-images---photos')) return;
   // Attendre que les éléments HTML soient bien présents
   const interval = setInterval(() => {
     const mainImage = document.getElementById('mainImage');
@@ -259,7 +261,7 @@ function initCarousel({ mainImage, prevArrow, nextArrow, caption, thumbsContaine
   });
 
 }
-
+/////////////////end diaporama ressource //////////
 
 
 //////////////////////////start classe en JS si des filtres sont présents///////////
@@ -270,22 +272,7 @@ 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
-//     }
-//   }
-// });
+//////////////////////////end classe en JS si des filtres sont présents///////////
 
 // ////////////////// start tronquage sous titre  //////////////////
   document.addEventListener("DOMContentLoaded", function () {
@@ -300,4 +287,5 @@ document.addEventListener('DOMContentLoaded', () => {
       }
     });
   });
+  // //////////////////end tronquage sous titre  //////////////////
 

部分文件因为文件数量过多而无法显示