From dca1cdc44060f447dc72a26f0d990bb82e2a35ce Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 17 Jul 2017 15:29:13 -0400 Subject: [PATCH] Fix: Ctrl+Shift+B also swaps between the background like Ctrl+B (closes #4153) --- modules/ui/background.js | 8 +++++++- modules/ui/info.js | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/ui/background.js b/modules/ui/background.js index d1aa4f016..e4996216d 100644 --- a/modules/ui/background.js +++ b/modules/ui/background.js @@ -305,13 +305,19 @@ export function uiBackground(context) { function toggle() { - if (d3.event) d3.event.preventDefault(); + if (d3.event) { + d3.event.preventDefault(); + } tooltipBehavior.hide(button); setVisible(!button.classed('active')); } function quickSwitch() { + if (d3.event) { + d3.event.stopImmediatePropagation(); + d3.event.preventDefault(); + } if (previous) { clickSetSource(previous); } diff --git a/modules/ui/info.js b/modules/ui/info.js index 6f02ca501..4a9790838 100644 --- a/modules/ui/info.js +++ b/modules/ui/info.js @@ -78,7 +78,10 @@ export function uiInfo(context) { function toggle(which) { - if (d3.event) d3.event.preventDefault(); + if (d3.event) { + d3.event.stopImmediatePropagation(); + d3.event.preventDefault(); + } var activeids = ids.filter(function(k) { return active[k]; });