mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Syncs minimap toggle button and keyboard shortcut (using same method).
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user