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).on('page:load', init_collapse);
$(document).ready(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() { function the_terms() {
var the_terms = $("#dossier_autorisation_donnees"); 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_menu #logos').toggle(100);
$('.row.etape.etape_1 .etapes_informations #description_procedure').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.row.show-block#messages
%div.header %div.header
%div.col-lg-10.col-md-10.title %div.col-lg-10.col-md-10.title
%div.carret-right.hidden %div.carret-right
%div.carret-down %div.carret-down.hidden
MESSAGES MESSAGES
%div.col-lg-2.col-md-2.count %div.col-lg-2.col-md-2.count
2 messages 2 messages
@ -14,6 +14,7 @@
%div.header %div.header
%div.col-lg-12.col-md-12.title %div.col-lg-12.col-md-12.title
%div.carret-right %div.carret-right
%div.carret-down.hidden
INFORMATIONS ENTREPRISE / ASSOCIATION / INDIVIDU INFORMATIONS ENTREPRISE / ASSOCIATION / INDIVIDU
%div.body %div.body
@ -21,6 +22,7 @@
%div.header %div.header
%div.col-lg-10.col-md-10.title %div.col-lg-10.col-md-10.title
%div.carret-right %div.carret-right
%div.carret-down.hidden
CONSTRUCTION DU DOSSIER CONSTRUCTION DU DOSSIER
%div.col-lg-2.col-md-2.action %div.col-lg-2.col-md-2.action
EDITER EDITER