|
|
|
@ -90,7 +90,6 @@ jQuery(function($){
|
|
|
|
|
if (index === active_index) {
|
|
|
|
|
$(this).addClass('active').siblings().removeClass('active');
|
|
|
|
|
var target = $(this).find('>a').attr('href');
|
|
|
|
|
console.log('tab active:' + target);
|
|
|
|
|
tab_show_content($node, target);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -113,6 +112,54 @@ jQuery(function($){
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$('.fabrique-tabs').each(function(){tabs_init($(this));});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof Sortable === 'function') {
|
|
|
|
|
$(".accordion-sortable").each(function () {
|
|
|
|
|
// détruire / recréer le sortable à chaque appel ajax
|
|
|
|
|
if (Sortable.get(this)) {
|
|
|
|
|
Sortable.get(this).destroy();
|
|
|
|
|
}
|
|
|
|
|
var $me = $(this);
|
|
|
|
|
// pas de tri possible s'il n'y a qu'un seul élément.
|
|
|
|
|
if ($me.find('> .box').length < 2) {
|
|
|
|
|
$me.find('.deplacer-box').hide();
|
|
|
|
|
return true; // continue
|
|
|
|
|
} else {
|
|
|
|
|
$me.find('.deplacer-box').show();
|
|
|
|
|
}
|
|
|
|
|
$me.find('>.box').each(function(){
|
|
|
|
|
var id = $(this).attr('id');
|
|
|
|
|
if (id && !$(this).attr('data-id')) {
|
|
|
|
|
$(this).attr('data-id', id);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
new Sortable(this, {
|
|
|
|
|
direction: 'vertical',
|
|
|
|
|
swapThreshold: .8,
|
|
|
|
|
ghostClass: "deplacer-box-placeholder",
|
|
|
|
|
onStart: function(event) {
|
|
|
|
|
$(event.item).addClass('box-en-mouvement');
|
|
|
|
|
},
|
|
|
|
|
onEnd: function(event) {
|
|
|
|
|
$(event.item).removeClass('box-en-mouvement');
|
|
|
|
|
},
|
|
|
|
|
onUpdate: function (event) {
|
|
|
|
|
var tab = $(event.item).parent().data('tab');
|
|
|
|
|
var champOrder = this.toArray();
|
|
|
|
|
console.log(this);
|
|
|
|
|
console.log(champOrder);
|
|
|
|
|
var form = $(event.item).closest('form');
|
|
|
|
|
// on génère un hidden tu type
|
|
|
|
|
// <input type="hidden" name="f_action[champorder][0]" value="objet0-champ0,objet0-champ1,objet0-champ2,objet0-champ3,objet0-champ4,objet0-champ5,objet0-champ6,objet0-champ7,objet0-champ9,objet0-champ8,objet0-champ10,objet0-champ11,objet0-champ12,objet0-champ13,objet0-champ14,objet0-champ15,objet0-champ16,objet0-champ17">
|
|
|
|
|
form.find('div:first')
|
|
|
|
|
.prepend('<input type="hidden" name="f_action[champorder][' + tab + ']" value="'+ champOrder + '">');
|
|
|
|
|
form.submit();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Installer les onglets et accordions
|
|
|
|
|
|
|
|
|
|