From 15b0ecec22f682a52e84c490dfb18920edc56d5a Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 16 Mar 2021 10:39:07 -0600 Subject: [PATCH] Solve the problem with mail selecting the next mail and marking it as read when you move a mail by turning off the select-next-row thing for mail --- api/js/etemplate/et2_extension_nextmatch.js | 8 +++++++- api/js/etemplate/et2_extension_nextmatch.ts | 8 +++++++- mail/templates/default/index.xet | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index 6bcac7fd3e..a6e008fe16 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -525,7 +525,7 @@ var et2_nextmatch = /** @class */ (function (_super) { this.controller.deleteRow(uid); } // Select & focus next row - if (next && next.id) { + if (next && next.id && !this.options.disable_selection_advance) { this.controller._selectionMgr.setSelected(next.id, true); this.controller._selectionMgr.setFocused(next.id, true); } @@ -2337,6 +2337,12 @@ var et2_nextmatch = /** @class */ (function (_super) { "description": "Disable the ability to autorefresh the nextmatch on a regular interval. ", "default": false }, + "disable_selection_advance": { + "name": "Disable selection advance", + "type": "boolean", + "description": "If a refresh deletes the currently selected row, we normally advance the selection to the next row. Set to true to stop this.", + "default": false + }, "view": { "name": "View", "type": "string", diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index 70974d7a96..e645ab8f48 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -189,6 +189,12 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 "description": "Disable the ability to autorefresh the nextmatch on a regular interval. ", "default": false }, + "disable_selection_advance": { + "name": "Disable selection advance", + "type": "boolean", + "description": "If a refresh deletes the currently selected row, we normally advance the selection to the next row. Set to true to stop this.", + "default": false + }, "view": { "name": "View", "type": "string", @@ -817,7 +823,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 } // Select & focus next row - if(next && next.id) + if(next && next.id && !this.options.disable_selection_advance) { this.controller._selectionMgr.setSelected(next.id, true); this.controller._selectionMgr.setFocused(next.id, true); diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet index 5173de5450..f103f5ccd0 100644 --- a/mail/templates/default/index.xet +++ b/mail/templates/default/index.xet @@ -4,7 +4,7 @@