summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-11-23 18:42:18 +0000
committeralecpl <alec@alec.pl>2011-11-23 18:42:18 +0000
commitd65dd9cbe81031244fd9af047a474bb08f6045ef (patch)
tree8d693cc55e41f248419e037102d9894a1bd5bd63 /program/js/app.js
parente7c445bea0dd19e19b8e403aef48deb59f52b0d9 (diff)
- Small optimisations
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 4c7790f4f..d784f5354 100644
--- a/program/js/app.js
+++ b/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) {