diff options
-rw-r--r-- | program/js/app.js | 11 | ||||
-rw-r--r-- | program/steps/addressbook/func.inc | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/program/js/app.js b/program/js/app.js index 963049b4e..978a31627 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -4563,8 +4563,15 @@ function rcube_webmail() var lastelem = $('.ff_'+col), appendcontainer = $('#contactsection'+section+' .contactcontroller'+col); - if (!appendcontainer.length) - appendcontainer = $('<fieldset>').addClass('contactfieldgroup contactcontroller'+col).insertAfter($('#contactsection'+section+' .contactfieldgroup').last()); + if (!appendcontainer.length) { + 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') { var input, colprop = this.env.coltypes[col], diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index eb8a0e597..e32ce5a12 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -669,7 +669,7 @@ function rcmail_contact_form($form, $record, $attrib = null) } } - if (!$content) + if (!$content && !$edit_mode) continue; // also render add-field selector |