summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-04-07 17:58:20 +0000
committeralecpl <alec@alec.pl>2008-04-07 17:58:20 +0000
commitd41d67add6d2bc226544148730928ca31a2c4313 (patch)
tree7df6d568394e3592821fd88427453d72c96cbf71 /program
parente7886405d89806e79940976e6a8faad0374bb6be (diff)
- better commands enabling/disabling after get/post response, fixes:
when delete last (selected) message in mailbox content in preview pane should be cleaned, when delete last (selected) message in mailbox sellect-all, purge and others commands should be disabled, and probably other related bugs
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js24
-rw-r--r--program/steps/mail/move_del.inc1
2 files changed, 19 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js
index e6b6cff7c..a24745645 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3453,25 +3453,37 @@ function rcube_webmail()
// process the response data according to the sent action
switch (request_obj.__action)
{
+
case 'delete':
case 'moveto':
if (this.env.action=='show')
this.command('list');
else if (this.message_list)
this.message_list.init();
- break;
case 'purge':
+ case 'expunge':
+ if (!this.env.messagecount)
+ {
+ // clear preview pane content
+ if (this.env.contentframe)
+ this.show_contentframe(false);
+ // disable commands useless when mailbox is empty
+ this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource',
+ 'print', 'load-attachment', 'purge', 'expunge', 'select-all', 'select-none', 'sort', false);
+ }
+
+ break;
+
case 'list':
- this.enable_command('purge', (this.env.messagecount && (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox)));
this.msglist_select(this.message_list);
+ case 'check-recent':
case 'getunread':
- this.enable_command('sort', (this.env.messagecount > 0));
+ this.enable_command('show', 'expunge', 'select-all', 'select-none', 'sort', (this.env.messagecount > 0));
+ this.enable_command('purge', (this.env.messagecount && (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox)));
- case 'expunge':
- this.enable_command('select-all', 'select-none', 'expunge', this.env.messagecount ? true : false);
- break;
+ break;
}
diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc
index b6ec20773..3bc644f49 100644
--- a/program/steps/mail/move_del.inc
+++ b/program/steps/mail/move_del.inc
@@ -80,6 +80,7 @@ if ($IMAP->list_page > 1 && $nextpage_count <= 0 && $remaining == 0)
// update message count display
$OUTPUT->set_env('pagecount', $pages);
+$OUTPUT->set_env('messagecount', $msg_count);
$OUTPUT->set_env('current_page', $IMAP->list_page);
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count));