From 15dcf9553eb5ca6672ddb79eb40263a27649c79b Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 27 Jul 2022 13:30:11 +0000 Subject: [PATCH] Fix the unintentional selection of rows with the context menu (#37481). Patch by Takashi Kato. git-svn-id: https://svn.redmine.org/redmine/trunk@21738 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/context_menu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/javascripts/context_menu.js b/public/javascripts/context_menu.js index 0dd6ad6b9..8a2bb7495 100644 --- a/public/javascripts/context_menu.js +++ b/public/javascripts/context_menu.js @@ -52,11 +52,12 @@ function contextMenuClick(event) { if (lastSelected.length) { var toggling = false; $('.hascontextmenu').each(function(){ - if (toggling || $(this).is(tr)) { + $elm = $(this) + if (!$elm.is(lastSelected) && (toggling || $elm.is(tr))) { contextMenuAddSelection($(this)); contextMenuClearDocumentSelection(); } - if ($(this).is(tr) || $(this).is(lastSelected)) { + if ($elm.is(lastSelected) !== $elm.is(tr)) { toggling = !toggling; } });