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]; });