Pursuie over body animation with carets

This commit is contained in:
JC 2016-11-23 17:30:55 +01:00
parent 0b7020e065
commit 09fb3d4634
2 changed files with 33 additions and 11 deletions

View file

@ -3,15 +3,6 @@ $(document).ready(the_terms);
$(document).on('page:load', init_collapse);
$(document).ready(init_collapse);
function init_collapse() {
$('.title').click(function() {
var section = $(this).parents().closest(".show-block").children(".body");
return section.slideToggle(500, function () {});
});
}
function the_terms() {
var the_terms = $("#dossier_autorisation_donnees");
@ -53,3 +44,32 @@ function toggle_etape_1(){
$('.row.etape.etape_1 .etapes_menu #logos').toggle(100);
$('.row.etape.etape_1 .etapes_informations #description_procedure').toggle(100);
}
function openning_block(block) {
var right = $(block).find(".carret-right");
var down = $(block).find(".carret-down")
right.addClass("hidden");
down.removeClass("hidden");
}
function closing_block(block) {
var right = $(block).find(".carret-right");
var down = $(block).find(".carret-down")
right.removeClass("hidden");
down.addClass("hidden");
}
function init_collapse() {
$('.title').click(function() {
var block = $(this).parents().closest(".show-block");
var section = block.children(".body");
section.slideToggle(500, function () {});
if ($(section).is("visible") === true) {
closing_block(block);
}
if ($(section).is("visible") === false) {
openning_block(block);
}
});
}

View file

@ -3,8 +3,8 @@
%div.row.show-block#messages
%div.header
%div.col-lg-10.col-md-10.title
%div.carret-right.hidden
%div.carret-down
%div.carret-right
%div.carret-down.hidden
MESSAGES
%div.col-lg-2.col-md-2.count
2 messages
@ -14,6 +14,7 @@
%div.header
%div.col-lg-12.col-md-12.title
%div.carret-right
%div.carret-down.hidden
INFORMATIONS ENTREPRISE / ASSOCIATION / INDIVIDU
%div.body
@ -21,6 +22,7 @@
%div.header
%div.col-lg-10.col-md-10.title
%div.carret-right
%div.carret-down.hidden
CONSTRUCTION DU DOSSIER
%div.col-lg-2.col-md-2.action
EDITER