summaryrefslogtreecommitdiff
path: root/program/js/app.js
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/js/app.js
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/js/app.js')
-rw-r--r--program/js/app.js24
1 files changed, 18 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;
}