[Svn] r5475 - trunk/roundcubemail/program/js

trac at roundcube.net trac at roundcube.net
Wed Nov 23 19:42:18 CET 2011


Author: alec
Date: 2011-11-23 12:42:18 -0600 (Wed, 23 Nov 2011)
New Revision: 5475

Modified:
   trunk/roundcubemail/program/js/app.js
Log:
- Small optimisations


Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2011-11-23 18:06:40 UTC (rev 5474)
+++ trunk/roundcubemail/program/js/app.js	2011-11-23 18:42:18 UTC (rev 5475)
@@ -1380,20 +1380,16 @@
   this.collapse_folder = function(name)
   {
     var li = this.get_folder_li(name, '', true),
-      div = $(li.getElementsByTagName('div')[0]);
+      div = $('div:first', li),
+      ul = $('ul:first', li);
 
-    if (!div || (!div.hasClass('collapsed') && !div.hasClass('expanded')))
-      return;
-
-    var ul = $(li.getElementsByTagName('ul')[0]);
-
     if (div.hasClass('collapsed')) {
       ul.show();
       div.removeClass('collapsed').addClass('expanded');
       var reg = new RegExp('&'+urlencode(name)+'&');
       this.env.collapsed_folders = this.env.collapsed_folders.replace(reg, '');
     }
-    else {
+    else if (div.hasClass('expanded')) {
       ul.hide();
       div.removeClass('expanded').addClass('collapsed');
       this.env.collapsed_folders = this.env.collapsed_folders+'&'+urlencode(name)+'&';
@@ -1402,6 +1398,8 @@
       if (this.env.mailbox.indexOf(name + this.env.delimiter) == 0)
         this.command('list', name);
     }
+    else
+      return;
 
     // Work around a bug in IE6 and IE7, see #1485309
     if (bw.ie6 || bw.ie7) {

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list