[SUP-13463] fix liege backoffice js like frontoffice for custom list in table. See linked ticket

This commit is contained in:
Nicolas Hislaire 2020-07-08 12:00:00 +02:00
parent 74e5e703d4
commit ac7c28665f
1 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,6 @@ $(function() {
$.fn.field_substitution = function (field, clone, marginbottom) {
var nodename = field.find(':regex(id,form_.*)').prop('nodeName');
var old_table_input = $(this).find('input');
var new_field = null;
var new_table_div_field = field.clone(clone);
@ -52,11 +51,12 @@ $(function() {
new_table_div_field.find('.title').css('display', 'none');
new_table_div_field.css('margin-bottom', marginbottom);
old_table_input.css( 'display', 'none' );
if (nodename == 'SELECT') {
new_field = new_table_div_field.find('select');
} else {
if (new_table_div_field.find('input').length > 0) {
new_field = new_table_div_field.find('input');
}
if (new_table_div_field.find('select').length > 0) {
new_field = new_table_div_field.find('select');
}
try {
new_field.val(old_table_input.val());
} catch(e) {}