Skip to content

Commit ebb578e

Browse files
author
Mark Robinson
committed
Add ctrl holding to select multiple nodes
1 parent ba0c2de commit ebb578e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/main/resources/static/js/workflow.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ require(['jquery', 'jquery.svg', 'jquery.svgdom'],
255255
* When a table row is hovered over/clicked, highlight
256256
*/
257257
$("tr").not('thead tr').on({
258-
click: function() {
259-
$("polygon.selected, tr.selected").removeClass("selected");
258+
click: function(event) {
259+
if (!event.ctrlKey) {
260+
$("polygon.selected, tr.selected").not($(this)).removeClass("selected");
261+
}
260262
getGraphBox(this).toggleClass("selected");
261263
$(this).toggleClass("selected");
262264
},
@@ -280,17 +282,20 @@ require(['jquery', 'jquery.svg', 'jquery.svgdom'],
280282
// Find corresponding table row and return
281283
return $("tr").filter(function() {
282284
return $(this).find("td:first").html() == elementTitle;
283-
});
285+
}).add();
284286
}
285287

286288
/**
287289
* When a graph box is hovered over/clicked, highlight
288290
*/
289291
$(document).on({
290-
click: function() {
291-
$("polygon.selected, tr.selected").removeClass("selected");
292+
click: function(event) {
293+
var thisPolygon = $(this).find("polygon");
294+
if (!event.ctrlKey) {
295+
$("polygon.selected, tr.selected").not(thisPolygon).removeClass("selected");
296+
}
292297
getTableRow(this).toggleClass("selected");
293-
$(this).find("polygon").toggleClass("selected");
298+
thisPolygon.toggleClass("selected");
294299
},
295300
mouseenter: function() {
296301
getTableRow(this).addClass("hover");

0 commit comments

Comments
 (0)