From ddc24ca40015a445d5fec9916bac632249f9fcc8 Mon Sep 17 00:00:00 2001 From: Lubin Pappalardo Date: Sat, 30 Sep 2023 19:53:02 -0400 Subject: [PATCH] Activate switch on dbl click --- assets/scripts/components-control.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/scripts/components-control.js b/assets/scripts/components-control.js index de43e7d..a78478e 100644 --- a/assets/scripts/components-control.js +++ b/assets/scripts/components-control.js @@ -29,6 +29,12 @@ $('#activateSwitchComponent').click(function (e) { activateSwitch(SelectedComponent); }) +$(document).dblclick('.component', function(e) { + if (!$(e.target).hasClass('pin') && $(e.target).hasClass('switch')) { + activateSwitch($(e.target)); + } +}) + /* unselect on click on void */ $('#board').on('click', function (e) {