2016-11-24 19:33:34 +01:00
|
|
|
$(document).on('page:load', init_default_data_block);
|
|
|
|
$(document).ready(init_default_data_block);
|
|
|
|
|
|
|
|
function init_default_data_block() {
|
2016-11-29 14:46:01 +01:00
|
|
|
$('.default_data_block #dossier .body').toggle();
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
$('.default_data_block .title').click(function () {
|
|
|
|
toggle_default_data_bloc(this, 400);
|
|
|
|
});
|
|
|
|
|
2016-11-25 11:25:33 +01:00
|
|
|
$('.new-action').click(function () {
|
2016-11-29 14:46:01 +01:00
|
|
|
var messages_block = $(this).parents().closest('.default_data_block').find('.title')
|
2016-11-25 11:25:33 +01:00
|
|
|
toggle_default_data_bloc(messages_block, 400);
|
|
|
|
});
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
$('.default_data_block.default_visible').each(function() {
|
|
|
|
toggle_default_data_bloc($(this).find('.title'), 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
function toggle_default_data_bloc(element, duration){
|
|
|
|
var block = $(element).parents('.show-block');
|
2016-11-29 14:46:01 +01:00
|
|
|
if (block.attr('id') == 'messages') {
|
|
|
|
block.children('.last-commentaire').toggle();
|
2016-11-29 16:26:06 +01:00
|
|
|
$(".commentaires").animate({ scrollTop: $(this).height() }, "slow");
|
2016-11-25 11:08:58 +01:00
|
|
|
}
|
2016-11-24 19:33:34 +01:00
|
|
|
|
2016-11-29 14:46:01 +01:00
|
|
|
block.children('.body').slideToggle(duration);
|
2016-11-24 19:33:34 +01:00
|
|
|
|
2016-11-29 14:46:01 +01:00
|
|
|
block.find('.carret-right').toggle();
|
|
|
|
block.find('.carret-down').toggle();
|
2016-11-24 19:33:34 +01:00
|
|
|
}
|
|
|
|
}
|