ouidade 2 天之前
父節點
當前提交
b0c93b3eef
共有 2 個文件被更改,包括 20 次插入18 次删除
  1. 0 0
      web/themes/custom/eql/dist/assets/bundle.js
  2. 20 18
      web/themes/custom/eql/scripts/main.js

文件差異過大導致無法顯示
+ 0 - 0
web/themes/custom/eql/dist/assets/bundle.js


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

@@ -178,25 +178,27 @@ jQuery(function ($) {
   });
 
   // Scroll automatique au filtre
-  const form = document.querySelector(".views-exposed-form");
-  if (form) form.setAttribute("action", form.action.split("#")[0] + "#filtres");
-
-  if (window.location.hash === "#filtres") {
-    const target = document.getElementById("filtres");
-    if (target) {
-      const offset = 300;
-      const top = target.getBoundingClientRect().top + window.pageYOffset - offset;
-      window.scrollTo({ top: top, behavior: "smooth" });
+  if (document.body.classList.contains("path-projets")) {
+    const form = document.querySelector(".views-exposed-form");
+    if (form) form.setAttribute("action", form.action.split("#")[0] + "#filtres");
+
+    if (window.location.hash === "#filtres") {
+      const target = document.getElementById("filtres");
+      if (target) {
+        const offset = 300;
+        const top = target.getBoundingClientRect().top + window.pageYOffset - offset;
+        window.scrollTo({ top: top, behavior: "smooth" });
+      }
     }
-  }
 
-  // MASQUER TYPE DE RESSOURCE DOUBLON
-  $(".view-type-slide").each(function () {
-    const h3Content = $(this).find("h3").text().trim();
-    $(this).find(".field--name-field-type-de-ressource").each(function () {
-      if ($(this).text().trim() === h3Content) {
-        $(this).hide();
-      }
+    // MASQUER TYPE DE RESSOURCE DOUBLON
+    $(".view-type-slide").each(function () {
+      const h3Content = $(this).find("h3").text().trim();
+      $(this).find(".field--name-field-type-de-ressource").each(function () {
+        if ($(this).text().trim() === h3Content) {
+          $(this).hide();
+        }
+      });
     });
-  });
+  }
 });

部分文件因文件數量過多而無法顯示