This commit is contained in:
2025-05-22 21:34:22 +02:00
parent aee4ad30d6
commit b0c93b3eef
2 changed files with 21 additions and 19 deletions
File diff suppressed because one or more lines are too long
+20 -18
View File
@@ -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 (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();
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();
}
});
});
});
}
});