diff --git a/js/id/ui/background.js b/js/id/ui/background.js index 3a674d66c..d6236553b 100644 --- a/js/id/ui/background.js +++ b/js/id/ui/background.js @@ -261,9 +261,7 @@ iD.ui.Background = function(context) { .append('input') .attr('type', 'checkbox') .on('change', function() { - var exp = label.classed('active'); iD.ui.MapInMap.toggle(); - label.classed('active', !exp); d3.event.preventDefault(); }); diff --git a/js/id/ui/map_in_map.js b/js/id/ui/map_in_map.js index 5aff866d9..27cbc232c 100644 --- a/js/id/ui/map_in_map.js +++ b/js/id/ui/map_in_map.js @@ -244,6 +244,8 @@ iD.ui.MapInMap = function(context) { function toggle() { if (d3.event) d3.event.preventDefault(); + var label = d3.select('.minimap-toggle'); + if (hidden()) { selection .style('display', 'block') @@ -252,6 +254,9 @@ iD.ui.MapInMap = function(context) { .duration(200) .style('opacity', 1); + label.classed('active', true) + .select('input').property('checked', true); + redraw(); } else { @@ -264,6 +269,9 @@ iD.ui.MapInMap = function(context) { .each('end', function() { d3.select(this).style('display', 'none'); }); + + label.classed('active', false) + .select('input').property('checked', false); } }