summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2006-05-17 14:54:12 +0000
committersvncommit <devs@roundcube.net>2006-05-17 14:54:12 +0000
commitdab06575dc33646b50b56522c635ce4c2c6cb8a3 (patch)
treed7579bbae50e7a44d7dbd2c9e2d645bd1abb84db /program
parent4f2d81edf383b57c81faa8fc3f41d75f34c08bc8 (diff)
1)fixed bug where moving/deleting a single message in the list didn't work
2)fixed bug where marking a message as deleted from "view message" page caused errors
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/program/js/app.js b/program/js/app.js
index cd5eb96ba..fe5e4ce1e 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1206,6 +1206,7 @@ function rcube_webmail()
// get next and previous rows that are not hidden
this.get_next_row = function(){
+ if (!this.list_rows) return false;
var last_selected_row = this.list_rows[this.last_selected];
var new_row = last_selected_row.obj.nextSibling;
while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none')) {
@@ -1215,6 +1216,7 @@ function rcube_webmail()
}
this.get_prev_row = function(){
+ if (!this.list_rows) return false;
var last_selected_row = this.list_rows[this.last_selected];
var new_row = last_selected_row.obj.previousSibling;
while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none')) {
@@ -1543,7 +1545,7 @@ function rcube_webmail()
next_row = this.get_next_row();
prev_row = this.get_prev_row();
new_row = (next_row) ? next_row : prev_row;
- this.select_row(new_row.uid,false,false);
+ if (new_row) this.select_row(new_row.uid,false,false);
}
var lock = false;
@@ -1584,7 +1586,7 @@ function rcube_webmail()
next_row = this.get_next_row();
prev_row = this.get_prev_row();
new_row = (next_row) ? next_row : prev_row;
- this.select_row(new_row.uid,false,false);
+ if (new_row) this.select_row(new_row.uid,false,false);
// send request to server
this.http_request('delete', '_uid='+a_uids.join(',')+'&_mbox='+escape(this.env.mailbox)+'&_from='+(this.env.action ? this.env.action : ''));
@@ -1605,11 +1607,15 @@ function rcube_webmail()
this.permanently_remove_messages();
// if there isn't a defined trash mailbox and the config is set to flag for deletion
else if (!this.env.trash_mailbox && this.env.flag_for_deletion) {
- this.mark_message('delete');
- next_row = this.get_next_row();
- prev_row = this.get_prev_row();
- new_row = (next_row) ? next_row : prev_row;
- this.select_row(new_row.uid,false,false);
+ this.mark_message('delete',this.env.uid);
+ if(this.env.action=="show"){
+ this.command('nextmessage','',this);
+ } else {
+ next_row = this.get_next_row();
+ prev_row = this.get_prev_row();
+ new_row = (next_row) ? next_row : prev_row;
+ if (new_row) this.select_row(new_row.uid,false,false);
+ }
// if there isn't a defined trash mailbox and the config is set NOT to flag for deletion
}else if (!this.env.trash_mailbox && !this.env.flag_for_deletion) {
this.permanently_remove_messages();
@@ -1691,6 +1697,9 @@ function rcube_webmail()
if (this.env.read_when_deleted) {
this.toggle_read_status('read',a_uids);
}
+ // if deleting message from "view message" don't bother with delete icon
+ if (this.env.action == "show")
+ return false;
var icn_src;
for (var i=0; i<a_uids.length; i++)