From 3d35312cc4badb64a2c26db8e80c1a01f2d1c12b Mon Sep 17 00:00:00 2001 From: alecpl Date: Sat, 12 Apr 2008 17:37:22 +0000 Subject: - Fixed and optimized 'read_when_deleted': mark as read on server side in one action when marking as deleted, fixed js bugs when deleting from message preview page --- program/js/app.js | 135 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 51 deletions(-) (limited to 'program/js/app.js') diff --git a/program/js/app.js b/program/js/app.js index a62d8d8ec..3ed681719 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1407,7 +1407,7 @@ function rcube_webmail() this.delete_messages = function() { var selection = this.message_list ? this.message_list.get_selection() : new Array(); - + // exit if no mailbox specified or if selection is empty if (!this.env.uid && !selection.length) return; @@ -1458,8 +1458,9 @@ function rcube_webmail() this._with_selected_messages = function(action, lock, add_url) { var a_uids = new Array(); + if (this.env.uid) - a_uids[a_uids.length] = this.env.uid; + a_uids[0] = this.env.uid; else { var selection = this.message_list.get_selection(); @@ -1468,10 +1469,11 @@ function rcube_webmail() { id = selection[n]; a_uids[a_uids.length] = id; + this.message_list.remove_row(id, (n == selection.length-1)); } } - + // also send search request to get the right messages if (this.env.search_request) add_url += '&_search='+this.env.search_request; @@ -1487,20 +1489,23 @@ function rcube_webmail() var a_uids = new Array(); var r_uids = new Array(); var selection = this.message_list ? this.message_list.get_selection() : new Array(); - + if (uid) a_uids[0] = uid; else if (this.env.uid) a_uids[0] = this.env.uid; else if (this.message_list) { - for (var id, n=0; n 0)); - this.enable_command('purge', (this.env.messagecount && (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox))); - break; + 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))); + + break; } -- cgit v1.2.3