[Svn] r6065 - in trunk/roundcubemail/program: js steps/addressbook

trac at roundcube.net trac at roundcube.net
Thu Apr 12 10:39:40 CEST 2012


Author: alec
Date: 2012-04-12 03:39:40 -0500 (Thu, 12 Apr 2012)
New Revision: 6065

Modified:
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/steps/addressbook/func.inc
Log:
- Fix adding contact form fields in situation when the fieldset is empty.
  Fixes issue with lost manager/assistant fields in LDAP addressbook


Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2012-04-12 06:49:30 UTC (rev 6064)
+++ trunk/roundcubemail/program/js/app.js	2012-04-12 08:39:40 UTC (rev 6065)
@@ -4563,8 +4563,15 @@
       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],

Modified: trunk/roundcubemail/program/steps/addressbook/func.inc
===================================================================
--- trunk/roundcubemail/program/steps/addressbook/func.inc	2012-04-12 06:49:30 UTC (rev 6064)
+++ trunk/roundcubemail/program/steps/addressbook/func.inc	2012-04-12 08:39:40 UTC (rev 6065)
@@ -669,7 +669,7 @@
                 }
             }
 
-            if (!$content)
+            if (!$content && !$edit_mode)
                 continue;
 
             // also render add-field selector



More information about the svn mailing list