summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-11-23 18:42:18 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-11-23 18:42:18 +0000
commit51e1ea40b9d6668c6c2dba6a0eb8d23dc9a5edef (patch)
tree06c3487ebcc921d0ae46c68f705fe409badcfc71 /roundcubemail/program
parent2787fc2835560866f0710e1ae58773cd4c3c10b9 (diff)
- Small optimisations
git-svn-id: https://svn.roundcube.net/trunk@5475 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/js/app.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 4c7790f4f..d784f5354 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -1380,12 +1380,8 @@ function rcube_webmail()
this.collapse_folder = function(name)
{
var li = this.get_folder_li(name, '', true),
- div = $(li.getElementsByTagName('div')[0]);
-
- if (!div || (!div.hasClass('collapsed') && !div.hasClass('expanded')))
- return;
-
- var ul = $(li.getElementsByTagName('ul')[0]);
+ div = $('div:first', li),
+ ul = $('ul:first', li);
if (div.hasClass('collapsed')) {
ul.show();
@@ -1393,7 +1389,7 @@ function rcube_webmail()
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 @@ function rcube_webmail()
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) {