From c6f56b8221bae80c316a81e0b6cf7f45b9eaba85 Mon Sep 17 00:00:00 2001 From: Valerio Bozzolan Date: Sat, 18 Mar 2023 14:57:15 +0100 Subject: [PATCH] Workboard: fix CTRL+click on "Create Task" and "Edit Task" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: The CTRL+click now opens the links in a new tab, like any other normal link opened with CTRL+click. Note that the middle-click was already working. Closes T15157 Test Plan: - visit a Workboard - column > menu > mouse on "Create Task" - CTRL+click: open in new tab (→ now works) - normal click: open the pop-up (→ still works) - middle-click: open in new tab (→ still works) - column > single Task > mouse on "Edit" - CTRL+click: open in new tab (→ now works) - normal click: open the pop-up (→ still works) - middle-click: open in new tab (→ still works) Reviewers: O1 Blessed Committers, avivey Reviewed By: O1 Blessed Committers, avivey Subscribers: speck, tobiaswiese, Matthew, Cigaryno Maniphest Tasks: T15157 Differential Revision: https://we.phorge.it/D25072 --- .../js/application/projects/WorkboardController.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/webroot/rsrc/js/application/projects/WorkboardController.js b/webroot/rsrc/js/application/projects/WorkboardController.js index da5d177bb9..1b38638f3d 100644 --- a/webroot/rsrc/js/application/projects/WorkboardController.js +++ b/webroot/rsrc/js/application/projects/WorkboardController.js @@ -151,6 +151,13 @@ JX.install('WorkboardController', { }, _onaddcard: function(e) { + + // Allow CTRL+click and maybe other actions + if(!e.isNormalMouseEvent()) { + e.stop(); + return; + } + // We want the 'boards-dropdown-menu' behavior to see this event and // close the dropdown, but don't want to follow the link. e.prevent(); @@ -176,6 +183,13 @@ JX.install('WorkboardController', { }, _oneditcard: function(e) { + + // Allow CTRL+click and maybe other actions + if(!e.isNormalMouseEvent()) { + e.stop(); + return; + } + e.kill(); var column_node = e.getNode('project-column');