js recharge page projets filtrés au niveau des filtres
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -3978,6 +3978,9 @@ svg.ext {
|
|||||||
.path-projets .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-views-blockprojets-block-1 .view-projets {
|
.path-projets .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-views-blockprojets-block-1 .view-projets {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
.path-projets .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-views-blockprojets-block-1 .view-projets #filtres {
|
||||||
|
scroll-margin-top: 10rem;
|
||||||
|
}
|
||||||
.path-projets .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-views-blockprojets-block-1 .view-projets .view-filters {
|
.path-projets .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-views-blockprojets-block-1 .view-projets .view-filters {
|
||||||
margin-top: 4rem;
|
margin-top: 4rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -279,6 +279,29 @@ document.querySelectorAll('a[href^="http"]').forEach(link => {
|
|||||||
|
|
||||||
/////////////// end ouverture liens externes vers nouvel onglet //////////////////
|
/////////////// end ouverture liens externes vers nouvel onglet //////////////////
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const form = document.querySelector(".views-exposed-form");
|
||||||
|
|
||||||
|
// console.log(form);
|
||||||
|
|
||||||
|
if (form) {
|
||||||
|
form.setAttribute("action", form.action.split("#")[0] + "#filtres");
|
||||||
|
}
|
||||||
|
if (window.location.hash === "#filtres") {
|
||||||
|
const target = document.getElementById("filtres");
|
||||||
|
if (target) {
|
||||||
|
// target.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||||
|
const offset = 300;
|
||||||
|
const top = target.getBoundingClientRect().top + window.pageYOffset - offset;
|
||||||
|
|
||||||
|
window.scrollTo({
|
||||||
|
top: top,
|
||||||
|
behavior: "smooth"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
})(jQuery, window);
|
})(jQuery, window);
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,9 @@
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
||||||
//filtres
|
//filtres
|
||||||
|
#filtres {
|
||||||
|
scroll-margin-top: 10rem;
|
||||||
|
}
|
||||||
.view-filters{
|
.view-filters{
|
||||||
margin-top: 4rem;
|
margin-top: 4rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if exposed %}
|
{% if exposed %}
|
||||||
<div class="view-filters">
|
<div class="view-filters" id='filtres'>
|
||||||
{{ exposed }}
|
{{ exposed }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user