summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-12-12 19:59:08 +0100
committerAleksander Machniak <alec@alec.pl>2012-12-12 19:59:08 +0100
commit04689fa7ee89c29b57278a354b39d9ee5397a442 (patch)
tree9f58631180d1341d915aba5e9ee4824853383017 /program/js/app.js
parent0435f40999564586dd9bd9669696ec04c16f2e32 (diff)
Fix so compacting of non-empty folder is possible also when messages list is empty (#1488858)
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 4094a67ad..b5bf1840a 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -651,13 +651,13 @@ function rcube_webmail()
break;
case 'expunge':
- if (this.env.messagecount)
+ if (this.env.exists)
this.expunge_mailbox(this.env.mailbox);
break;
case 'purge':
case 'empty-mailbox':
- if (this.env.messagecount)
+ if (this.env.exists)
this.purge_mailbox(this.env.mailbox);
break;
@@ -2971,7 +2971,7 @@ function rcube_webmail()
// test if purge command is allowed
this.purge_mailbox_test = function()
{
- return (this.env.messagecount && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
+ return (this.env.exists && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
|| this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))
|| this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter))));
};
@@ -6228,7 +6228,7 @@ function rcube_webmail()
case 'purge':
case 'expunge':
if (this.task == 'mail') {
- if (!this.env.messagecount) {
+ if (!this.env.exists) {
// clear preview pane content
if (this.env.contentframe)
this.show_contentframe(false);
@@ -6248,7 +6248,8 @@ function rcube_webmail()
this.env.qsearch = null;
case 'list':
if (this.task == 'mail') {
- this.enable_command('show', 'expunge', 'select-all', 'select-none', (this.env.messagecount > 0));
+ this.enable_command('show', 'select-all', 'select-none', this.env.messagecount > 0);
+ this.enable_command('expunge', this.env.exists);
this.enable_command('purge', this.purge_mailbox_test());
this.enable_command('expand-all', 'expand-unread', 'collapse-all', this.env.threading && this.env.messagecount);