Commit 4de1b2df authored by Théo GUILLON's avatar Théo GUILLON

Correction : lors de l'enregistrement d'un formulaire on reselectionne...

Correction : lors de l'enregistrement d'un formulaire on reselectionne l'onglet actif au moment de la redirection de la sauvegarde
parent 3cf5b61d
......@@ -39,6 +39,7 @@ if (isset($this->validationErrors['Formulaire']) && !empty($this->validationErro
}
echo $this->WebcilForm->create('Formulaire', [
'id' => 'addAndEditForm',
'autocomplete' => 'off',
'inputDefaults' => ['div' => false],
'class' => 'form-horizontal',
......
......@@ -7,7 +7,9 @@ $(document).ready(function () {
let success = true,
dynamicFields = [],
errorTabId = null;
errorTabId = null,
liTabActive = $('#addAndEditForm li.active a').attr("href"),
divTabActive = $('#addAndEditForm div.active').attr('id');
$('.ui-droppable').each(function(idxDroppable, droppable) {
if (success === false) {
......@@ -252,11 +254,12 @@ $(document).ready(function () {
});
});
// $('.active').removeClass('active');
// $('#info_complementaire').addClass('active');
// $('#onglet_info_complementaire').addClass('active');
$('.active').removeClass('active');
if (success === true) {
$('#'+divTabActive).addClass('active');
$('a[href="'+liTabActive+'"]').parent().addClass('active');
$.each(dynamicFields, function(idx, hidden) {
$('form').append(hidden);
});
......@@ -266,7 +269,6 @@ $(document).ready(function () {
console.log(errorTabId);
$(errorTabId).addClass('active');
$('a[href="'+errorTabId+'"]').parent().addClass('active');
// $('#onglet_info_complementaire').addClass('active');
event.preventDefault();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment