mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-07 03:41:33 +00:00
Fix mixup around events so that background and geocoder close each other
This commit is contained in:
@@ -140,27 +140,20 @@ iD.ui.Background = function(context) {
|
||||
content.selectAll('.toggle-list li:first-child a').node().focus();
|
||||
}
|
||||
|
||||
function blockClick() {
|
||||
selection.on('mousedown.help-inside', function() {
|
||||
return d3.event.stopPropagation();
|
||||
});
|
||||
selection.on('mousedown.help-inside', function() {
|
||||
return d3.event.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
function setVisible(show) {
|
||||
if (show !== shown) {
|
||||
button.classed('active', show);
|
||||
shown = show;
|
||||
|
||||
if (show) {
|
||||
selection.on('mousedown.background-inside', function() {
|
||||
return d3.event.stopPropagation();
|
||||
});
|
||||
content.style('display', 'block')
|
||||
.style('left', '-500px')
|
||||
.transition()
|
||||
.duration(200)
|
||||
.style('left', '30px')
|
||||
.each('end', blockClick);
|
||||
.style('left', '30px');
|
||||
} else {
|
||||
content.style('display', 'block')
|
||||
.style('left', '30px')
|
||||
@@ -227,7 +220,7 @@ iD.ui.Background = function(context) {
|
||||
|
||||
gpxLayerItem.call(bootstrap.tooltip()
|
||||
.title(t('gpx.drag_drop'))
|
||||
.placement('right'))
|
||||
.placement('right'));
|
||||
|
||||
gpxLayerItem.append('span')
|
||||
.text(t('gpx.local_layer'));
|
||||
|
||||
@@ -94,15 +94,6 @@ iD.ui.Geocoder = function(context) {
|
||||
setVisible(!button.classed('active'));
|
||||
}
|
||||
|
||||
function blockClick() {
|
||||
selection.on('mousedown.help-inside', function() {
|
||||
return d3.event.stopPropagation();
|
||||
});
|
||||
selection.on('mousedown.help-inside', function() {
|
||||
return d3.event.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
function setVisible(show) {
|
||||
if (show !== shown) {
|
||||
button.classed('active', show);
|
||||
@@ -117,14 +108,17 @@ iD.ui.Geocoder = function(context) {
|
||||
}
|
||||
|
||||
if (show) {
|
||||
selection.on('mousedown.geocoder-inside', function() {
|
||||
return d3.event.stopPropagation();
|
||||
});
|
||||
gcForm.style('display', 'block')
|
||||
.style('left', '-500px')
|
||||
.transition()
|
||||
.duration(200)
|
||||
.style('left', '30px')
|
||||
.each('end', blockClick);
|
||||
.style('left', '30px');
|
||||
inputNode.node().focus();
|
||||
} else {
|
||||
selection.on('mousedown.geocoder-inside', null);
|
||||
gcForm.style('display', 'block')
|
||||
.style('left', '30px')
|
||||
.transition()
|
||||
@@ -133,7 +127,6 @@ iD.ui.Geocoder = function(context) {
|
||||
.each('end', function() {
|
||||
d3.select(this).style('display', 'none');
|
||||
});
|
||||
selection.on('mousedown.background-inside', null);
|
||||
inputNode.node().blur();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user