Commit 157edcd1 authored by THEO GUILLON's avatar THEO GUILLON
Browse files

Merge branch...

Merge branch '393-les-retours-a-la-ligne-ne-sont-pas-pris-en-compte-dans-les-champs-de-formulaires-de-type' into '2.0.0'

Resolve "Les retours à la ligne ne sont pas pris en compte dans les champs de formulaires de type """

See merge request libriciel/pole-citoyens/web-DPO/web-DPO!395
parents cde32a53 5df4afc8
......@@ -694,7 +694,7 @@ let createForm = function(typeCreateForm) {
'Contenu' +
'<span class="obligatoire"> *</span>' +
'</label>' +
'<textarea class="form-control texteForm" name="content-texte" id="content-texte">' + $(idContainer).find('.ui-selected').find('h5').html() + '</textarea>' +
'<textarea class="form-control texteForm" name="content-texte" id="content-texte">' + $(idContainer).find('.ui-selected').find('h5').text() + '</textarea>' +
'</div>' +
'</div>' +
btnGroupsTrashApplicable
......@@ -1244,7 +1244,12 @@ let createForm = function(typeCreateForm) {
// Attribution les valeurs au champ "Label"
if ($(this).hasClass('texte')) {
$(idContainer).find('.ui-selected').find('h5').html(newContenuField);
let breakTag = (newContenuField || typeof newContenuField === 'undefined') ? '<br ' + '/>' : '<br>'
let test = (newContenuField + '').replace(/(\r\n|\n\r|\r|\n)/g, breakTag + '$1');
console.log(test);
$(idContainer).find('.ui-selected').find('h5').html(test);
// $(idContainer).find('.ui-selected').find('h5').html(newContenuField);
}
});
......
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