summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-04-08 16:34:36 +0000
committeralecpl <alec@alec.pl>2012-04-08 16:34:36 +0000
commit1b30a710cfe7fb2917ed337c52b06bb2236e1a05 (patch)
tree80465019a2941d6fa4ea8c67cb71e1c43d2e7447 /program/js
parent84b028ce0054a053f4aa019f311b507bb9faed08 (diff)
- Add option to delete messages instead of moving to Trash when in Junk folder (#1486686)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 5fe97c9fd..120e5459f 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -220,8 +220,7 @@ function rcube_webmail()
$(this.gui_objects.qsearchbox).focusin(function() { rcmail.message_list.blur(); });
}
- if (!this.env.flag_for_deletion && this.env.trash_mailbox && this.env.mailbox != this.env.trash_mailbox)
- this.set_alttext('delete', 'movemessagetotrash');
+ this.set_button_titles();
this.env.message_commands = ['show', 'reply', 'reply-all', 'reply-list', 'forward',
'moveto', 'copy', 'delete', 'open', 'mark', 'edit', 'viewsource', 'download',
@@ -573,13 +572,10 @@ function rcube_webmail()
this.reset_qsearch();
if (this.task == 'mail') {
this.list_mailbox(props);
-
- if (this.env.trash_mailbox && !this.env.flag_for_deletion)
- this.set_alttext('delete', this.env.mailbox != this.env.trash_mailbox ? 'movemessagetotrash' : 'deletemessage');
+ this.set_button_titles();
}
- else if (this.task == 'addressbook') {
+ else if (this.task == 'addressbook')
this.list_contacts(props);
- }
break;
case 'load-headers':
@@ -2570,6 +2566,9 @@ function rcube_webmail()
// @TODO: we should check if defined trash mailbox exists
else if (!trash || this.env.mailbox == trash)
this.permanently_remove_messages();
+ // we're in Junk folder and delete_junk is enabled
+ else if (this.env.delete_junk && this.env.junk_mailbox && this.env.mailbox == this.env.junk_mailbox)
+ this.permanently_remove_messages();
// if there is a trash mailbox defined and we're not currently in it
else {
// if shift was pressed delete it immediately
@@ -2869,6 +2868,19 @@ function rcube_webmail()
return this.select_all_mode ? '*' : uids.join(',');
};
+ // Sets title of the delete button
+ this.set_button_titles = function()
+ {
+ var label = 'deletemessage';
+
+ if (!this.env.flag_for_deletion
+ && this.env.trash_mailbox && this.env.mailbox != this.env.trash_mailbox
+ && (!this.env.delete_junk || !this.env.junk_mailbox || this.env.mailbox != this.env.junk_mailbox)
+ )
+ label = 'movemessagetotrash';
+
+ this.set_alttext('delete', label);
+ };
/*********************************************************/
/********* mailbox folders methods *********/