summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-05-26 17:18:01 +0000
committeralecpl <alec@alec.pl>2010-05-26 17:18:01 +0000
commitd470f970382373841d048ebac781f4991845bc0e (patch)
tree6dd97f25c631ae0ff17d1eea10cd9173c73ee896 /program
parent982e0b0b898ab2227d1493fe32ea51f85ecec294 (diff)
- fix FF crash (#1486752)
- fix some issues after deleting last message from the list
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js29
1 files changed, 14 insertions, 15 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 18cabc246..5abba1bc8 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1052,18 +1052,21 @@ function rcube_webmail()
// set command(s) enabled or disabled
this.enable_command = function()
{
- var args = arguments, len = args.length,
- command, enable = args[len-1];
-
- for (var n=0, len=len-1; n<len; n++) {
- if (typeof args[n] === 'object') {
- for (var i in args[n])
- this.enable_command(args[n][i], enable);
- continue;
+ var args = Array.prototype.slice.call(arguments),
+ enable = args.pop(), cmd;
+
+ for (var n=0; n<args.length; n++) {
+ cmd = args[n];
+ // argument of type array
+ if (typeof cmd === 'string') {
+ this.commands[cmd] = enable;
+ this.set_button(cmd, (enable ? 'act' : 'pas'));
+ }
+ // push array elements into commands array
+ else {
+ for (var i in cmd)
+ args.push(cmd[i]);
}
- command = args[n];
- this.commands[command] = enable;
- this.set_button(command, (enable ? 'act' : 'pas'));
}
};
@@ -4953,13 +4956,9 @@ function rcube_webmail()
// re-enable commands on move/delete error
this.enable_command(this.env.message_commands, true);
}
- else if (this.task == 'mail') {
- this.triggerEvent('listupdate', { folder:this.env.mailbox, rowcount:this.message_list.rowcount });
- }
else if (this.task == 'addressbook') {
this.triggerEvent('listupdate', { folder:this.env.source, rowcount:this.contact_list.rowcount });
}
- break;
case 'purge':
case 'expunge':