From a7bfdf36fe0efb6763ccb00f32de4c2c771d38ab Mon Sep 17 00:00:00 2001 From: the0ne Date: Thu, 15 Feb 2024 15:14:41 +0100 Subject: [PATCH] invert the display_next flag if user holds shift while deleting --- program/js/app.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/program/js/app.js b/program/js/app.js index 14ab5fb93cc..ee5343d47b7 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3517,11 +3517,19 @@ function rcube_webmail() { // delete selected messages from the current mailbox this.delete_messages = function (event, uid) { - var list = this.message_list, trash = this.env.trash_mailbox; + var list = this.message_list, trash = this.env.trash_mailbox, + display_next = this.env.display_next; + + // invert the display_next flag in case shift is pressed + if ((list && list.modkey == SHIFT_KEY) || (event && rcube_event.get_modifier(event) == SHIFT_KEY)) { + this.env.display_next = !display_next; + } // if config is set to flag for deletion if (this.env.flag_for_deletion) { this.mark_message('delete', uid); + + this.env.display_next = display_next; return false; } // if there isn't a defined trash mailbox or we are in it @@ -3544,6 +3552,7 @@ function rcube_webmail() { } } + this.env.display_next = display_next; return true; };