ajout du dropdown dans la page collectif
This commit is contained in:
@@ -13,6 +13,8 @@ $(document).ready( () => {
|
||||
} else if ($('main').children(":first").attr('id') == 'reader') {
|
||||
hideFooter()
|
||||
displayReader()
|
||||
} else if ($('main').children(":first").attr('id') == 'text-content') {
|
||||
addToggleBiography()
|
||||
}
|
||||
initBarba()
|
||||
})
|
||||
@@ -69,7 +71,10 @@ function initBarba() {
|
||||
loadProjetIndex()
|
||||
filterWhenEntering()
|
||||
} else if ($(data.next.container).attr('id') == 'text-content')
|
||||
{ if (isDesktopDevice) { displayFooter() } }
|
||||
{
|
||||
if (isDesktopDevice) displayFooter()
|
||||
addToggleBiography()
|
||||
}
|
||||
})
|
||||
barba.hooks.after((data) => {
|
||||
let pageTitleComparator, navIndex
|
||||
@@ -813,3 +818,19 @@ function hideFooterOnResize() {
|
||||
$('footer').css('display', 'none')
|
||||
}
|
||||
}
|
||||
|
||||
// dropdown collectif
|
||||
function addToggleBiography() {
|
||||
$('h4 + p > em, h4').on('click', toggleBiographie);
|
||||
$('h4 + p > em').append('<img src="/user/themes/figureslibres-v2/images/pictos/chevron-down.svg" aria-hidden="true">');
|
||||
}
|
||||
|
||||
function toggleBiographie(el) {
|
||||
if (el.target.tagName === "H4") {
|
||||
el.target.nextElementSibling.nextElementSibling.classList.toggle('open');
|
||||
el.target.nextElementSibling.firstElementChild.firstElementChild.classList.toggle('open');
|
||||
} else {
|
||||
el.target.firstElementChild.classList.toggle('open');
|
||||
el.target.parentElement.nextElementSibling.classList.toggle('open');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user