summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js11
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],