- Fix adding contact form fields in situation when the fieldset is empty.

Fixes issue with lost manager/assistant fields in LDAP addressbook
pull/1/head
alecpl 13 years ago
parent 2c4d0bc88e
commit c71e95b775

@ -4563,8 +4563,15 @@ function rcube_webmail()
var lastelem = $('.ff_'+col), var lastelem = $('.ff_'+col),
appendcontainer = $('#contactsection'+section+' .contactcontroller'+col); appendcontainer = $('#contactsection'+section+' .contactcontroller'+col);
if (!appendcontainer.length) if (!appendcontainer.length) {
appendcontainer = $('<fieldset>').addClass('contactfieldgroup contactcontroller'+col).insertAfter($('#contactsection'+section+' .contactfieldgroup').last()); var sect = $('#contactsection'+section),
lastgroup = $('.contactfieldgroup', sect).last();
appendcontainer = $('<fieldset>').addClass('contactfieldgroup contactcontroller'+col);
if (lastgroup.length)
appendcontainer.insertAfter(lastgroup);
else
sect.prepend(appendcontainer);
}
if (appendcontainer.length && appendcontainer.get(0).nodeName == 'FIELDSET') { if (appendcontainer.length && appendcontainer.get(0).nodeName == 'FIELDSET') {
var input, colprop = this.env.coltypes[col], var input, colprop = this.env.coltypes[col],

@ -669,7 +669,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
} }
} }
if (!$content) if (!$content && !$edit_mode)
continue; continue;
// also render add-field selector // also render add-field selector

Loading…
Cancel
Save