From 1c585394b5d08124451340b0e75df060c3f6a23a Mon Sep 17 00:00:00 2001 From: svncommit Date: Wed, 24 May 2006 18:25:47 +0000 Subject: Fixed bug with toggling new status of message after it had been marked as deleted Addded undelete functionality that works like Thunderbird (pressing delete icon/key on deleted message undeletes) fixed many but not all of the 'strict' javascript error messages --- program/js/app.js | 152 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 111 insertions(+), 41 deletions(-) (limited to 'program/js') diff --git a/program/js/app.js b/program/js/app.js index da7d18c9a..a6b43cb8e 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -29,6 +29,7 @@ function rcube_webmail() this.commands = new Object(); this.selection = new Array(); this.last_selected = 0; + this.in_message_list = false; // create public reference to myself rcube_webmail_client = this; @@ -256,8 +257,8 @@ function rcube_webmail() // reset last clicked if user clicks on anything other than the message table this.reset_click = function() { - this.in_message_list = false; - }; + this.in_message_list = false; + }; this.click_on_list = function(e) { @@ -328,8 +329,12 @@ function rcube_webmail() for(var r=0; r 0) { this.message_rows[uid].classname = this.message_rows[uid].classname.replace(/\s*deleted/, ''); this.set_classname(this.message_rows[uid].obj, 'deleted', false); - - if (this.message_rows[uid].unread && this.env.unreadicon) - icn_src = this.env.unreadicon; - else if (this.message_rows[uid].replied && this.env.repliedicon) - icn_src = this.env.repliedicon; - else if (this.env.messageicon) - icn_src = this.env.messageicon; - } - + } + if (this.message_rows[uid].unread && this.env.unreadicon) + icn_src = this.env.unreadicon; + else if (this.message_rows[uid].replied && this.env.repliedicon) + icn_src = this.env.repliedicon; + else if (this.env.messageicon) + icn_src = this.env.messageicon; if (this.message_rows[uid].icon && icn_src) this.message_rows[uid].icon.src = icn_src; - } } + } + this.http_request('mark', '_uid='+a_uids.join(',')+'&_flag=undelete'); + return true; } + + this.flag_as_deleted = function(a_uids) { + // if deleting message from "view message" don't bother with delete icon + if (this.env.action == "show") + return false; + for (var i=0; i