Skip to content
Snippets Groups Projects
Commit 8c415e1c authored by Benoit Alessandroni's avatar Benoit Alessandroni
Browse files

Merge branch 'integration/add-accordion' into 'master'

update: Add accordion on more criteria form

See merge request !135
parents 99755249 0b8e5808
No related branches found
No related tags found
1 merge request!135update: Add accordion on more criteria form
Pipeline #5439 failed
...@@ -128,6 +128,7 @@ div.block_list ...@@ -128,6 +128,7 @@ div.block_list
widget-review.status='cs-resource-status', widget-review.status='cs-resource-status',
search-widget-header_criterias="cs-section_header" search-widget-header_criterias="cs-section_header"
search-label-header_criterias="More criterias" search-label-header_criterias="More criterias"
search-class-header_criterias="accordion-form active"
search-label-format=`${data.Format}` search-label-format=`${data.Format}`
search-label-publication_year=`${data.DatePublication}` search-label-publication_year=`${data.DatePublication}`
......
...@@ -293,6 +293,27 @@ function manageAccordionByStep(){ ...@@ -293,6 +293,27 @@ function manageAccordionByStep(){
} }
} }
/**
* Manage the accordion "more criteria"
*/
function manageAccordionMoreCriteria(){
var acc = document.getElementsByClassName("accordion-form");
for (let item of acc) {
item.addEventListener("click", function() {
this.classList.toggle("active");
var panelForm = this.nextElementSibling;
if (!this.classList.contains("active")) {
panelForm.style.maxHeight = "0px";
refreshPagination();
} else {
panelForm.style.maxHeight = panelForm.scrollHeight + "px";
}
});
}
}
/** /**
* Manage the accordion for requested resources in the mentor dashboard * Manage the accordion for requested resources in the mentor dashboard
*/ */
...@@ -894,6 +915,8 @@ jQuery(document).ready(function($) { ...@@ -894,6 +915,8 @@ jQuery(document).ready(function($) {
window.setTimeout(() => { window.setTimeout(() => {
//Manage accordion by step //Manage accordion by step
manageAccordionByStep(); manageAccordionByStep();
//manage accordion for "More criteria"
manageAccordionMoreCriteria();
//Init the form file behaviour //Init the form file behaviour
// initFileUpload(); // initFileUpload();
......
...@@ -1482,6 +1482,31 @@ sib-multiple label, cs-resource-status[name="review.status"]+*{ ...@@ -1482,6 +1482,31 @@ sib-multiple label, cs-resource-status[name="review.status"]+*{
max-height: 1500px; max-height: 1500px;
} }
} }
/* Enable the accordion of "more criteria form"*/
sib-set-default[name="more_criterias_hidden"]{
max-height: 235px;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
.accordion-form h2{
position : relative
}
.accordion-form h2:after {
font-family: "Font Awesome 5 pro";
content: "\f078";
font-weight: 900;
right: 0;
position: absolute;
transform-origin: .7rem .7rem;
transform: rotate(0);
}
.accordion-form.active h2:after {
transform: rotate(-90deg);
}
/*XXXXXXXXXXXXXXXXXXXXX DETAIL RESSOURCES XXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/ /*XXXXXXXXXXXXXXXXXXXXX DETAIL RESSOURCES XXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
.format_type p{ .format_type p{
border-radius: 5px; border-radius: 5px;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment