From d82a23e5a90d77606256bdd59f799068ebd73a2c Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 25 Jul 2013 20:36:48 -0700 Subject: [PATCH] Don't focus when hiding --- js/id/ui/background.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/id/ui/background.js b/js/id/ui/background.js index a54219157..82373dead 100644 --- a/js/id/ui/background.js +++ b/js/id/ui/background.js @@ -149,8 +149,9 @@ iD.ui.Background = function(context) { function toggle() { if (d3.event) d3.event.preventDefault(); tooltip.hide(button); - setVisible(!button.classed('active')); - content.selectAll('.toggle-list label:first-child').node().focus(); + var visible = !button.classed('active'); + setVisible(visible); + if (visible) content.selectAll('.toggle-list label:first-child').node().focus(); } function setVisible(show) {