summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-26 17:18:01 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-26 17:18:01 +0000
commitf1f584176137f8b5bfa7c08ce98507f9d50ca57c (patch)
treed5460be5ec037a5cfca2f9908e13f285e74395c5 /roundcubemail/program
parent1d5a9fedbe9a7353a8b661c3620a2a1680417c73 (diff)
- fix FF crash (#1486752)
- fix some issues after deleting last message from the list git-svn-id: https://svn.roundcube.net/trunk@3671 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/js/app.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 18cabc246..5abba1bc8 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/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];
+ var args = Array.prototype.slice.call(arguments),
+ enable = args.pop(), cmd;
- 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;
+ 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':