make background and geocoder exclusive

This commit is contained in:
Ansis Brammanis
2013-03-15 18:02:44 -04:00
parent ff85d57b82
commit 9abc0cd9a7
2 changed files with 20 additions and 7 deletions

View File

@@ -44,14 +44,22 @@ iD.ui.Background = function(context) {
button.classed('active', show);
content.call(iD.ui.Toggle(show));
shown = show;
if (show) {
selection.on('mousedown.background-inside', function() {
return d3.event.stopPropagation();
});
} else {
selection.on('mousedown.background-inside', null);
}
}
}
selection.on('mousedown.background-inside', function() {
return d3.event.stopPropagation();
context.surface().on('mousedown.background-outside', function() {
setVisible(false);
});
context.surface().on('mousedown.background-outside', function() {
context.container().on('mousedown.background-outside', function() {
setVisible(false);
});

View File

@@ -86,6 +86,14 @@ iD.ui.Geocoder = function(context) {
if (show) inputNode.node().focus();
else inputNode.node().blur();
shown = show;
if (show) {
selection.on('mousedown.geocoder-inside', function() {
return d3.event.stopPropagation();
});
} else {
selection.on('mousedown.geocoder-inside', null);
}
}
}
var tooltip = bootstrap.tooltip()
@@ -112,11 +120,8 @@ iD.ui.Geocoder = function(context) {
var resultsList = selection.append('div')
.attr('class', 'content fillD map-overlay hide');
selection.on('mousedown.geocoder-inside', function() {
return d3.event.stopPropagation();
});
context.surface().on('mousedown.geocoder-outside', hide);
context.container().on('mousedown.b.geocoder-outside', hide);
var keybinding = d3.keybinding('geocoder');