diff options
author | alecpl <alec@alec.pl> | 2012-04-12 08:39:40 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2012-04-12 08:39:40 +0000 |
commit | c71e95b775f94ac39a0b83c7cdbd15c4f545f557 (patch) | |
tree | ed298f5d7f86a407bb4cd00592f3dc9814f890a0 /program/js/app.js | |
parent | 2c4d0bc88e44f07da6cdbad270265b43d3c36a15 (diff) |
- Fix adding contact form fields in situation when the fieldset is empty.
Fixes issue with lost manager/assistant fields in LDAP addressbook
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 11 |
1 files changed, 9 insertions, 2 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], |