summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js/app.js
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2012-04-12 08:39:40 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2012-04-12 08:39:40 +0000
commiteced3c00ed1c84ea4531646cd1746e4708ebcf8f (patch)
treec73a892bd23c132eec60348710432333a4024b34 /roundcubemail/program/js/app.js
parentb9219099df876ada5f2c83613f43b942a6eb0ca1 (diff)
- Fix adding contact form fields in situation when the fieldset is empty.
Fixes issue with lost manager/assistant fields in LDAP addressbook git-svn-id: https://svn.roundcube.net/trunk@6065 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/app.js')
-rw-r--r--roundcubemail/program/js/app.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 963049b4e..978a31627 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/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],