By default, mask all section in user form expect the first

This commit is contained in:
Xavier J 2016-10-19 14:35:42 +02:00
parent c2f014e59f
commit a781473b42
2 changed files with 9 additions and 2 deletions

View file

@ -54,7 +54,7 @@ function toggle_header_section_composents() {
header_section_id = target.id.split('mask_button_')[1];
header_section_composents = $(".header_section_" + header_section_id);
header_section_composents.slideToggle(200, function(){
header_section_composents.slideToggle(200, function () {
if (header_section_composents.css('display') == 'none') {
$(target).html('Afficher la section <i class="fa fa-chevron-down" />')
}
@ -63,4 +63,11 @@ function toggle_header_section_composents() {
}
});
});
$.each($("a.mask_section_button"), function (index, e) {
if (index != 0) {
$(e).click();
$(e).html('Afficher la section <i class="fa fa-chevron-down" />')
}
});
}

View file

@ -1,6 +1,6 @@
%h3.text-primary.page-header
=champ.libelle
%span.mask_section{style:'float: right'}
%a.mask_section_button.btn.btn-xs.btn-default{id: "mask_button_"+champ.id.to_s}
%a.mask_section_button.btn.btn-xs.btn-info{id: "mask_button_"+champ.id.to_s}
Masquer la section
%i.fa.fa-chevron-up