mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 23:14:47 +02:00
Ensure combobox menus are closed on blur (fixes #2207)
See 7c20bd3 for explanation.
This commit is contained in:
@@ -124,10 +124,6 @@ iD.ui.preset.address = function(field, context) {
|
||||
city = wrap.select('.addr-city');
|
||||
postcode = wrap.select('.addr-postcode');
|
||||
|
||||
wrap.selectAll('input')
|
||||
.on('blur', change)
|
||||
.on('change', change);
|
||||
|
||||
street
|
||||
.call(d3.combobox()
|
||||
.fetcher(function(value, callback) {
|
||||
@@ -145,6 +141,10 @@ iD.ui.preset.address = function(field, context) {
|
||||
.fetcher(function(value, callback) {
|
||||
callback(getPostCodes());
|
||||
}));
|
||||
|
||||
wrap.selectAll('input')
|
||||
.on('blur', change)
|
||||
.on('change', change);
|
||||
}
|
||||
|
||||
function change() {
|
||||
|
||||
@@ -14,6 +14,7 @@ iD.ui.preset.typeCombo = function(field) {
|
||||
.attr('id', 'preset-input-' + field.id);
|
||||
|
||||
input
|
||||
.call(combobox)
|
||||
.on('change', change)
|
||||
.on('blur', change)
|
||||
.each(function() {
|
||||
@@ -26,8 +27,7 @@ iD.ui.preset.typeCombo = function(field) {
|
||||
if (!err) options(_.pluck(data, 'value'));
|
||||
});
|
||||
}
|
||||
})
|
||||
.call(combobox);
|
||||
});
|
||||
|
||||
function options(opts) {
|
||||
combobox.data(opts.map(function(d) {
|
||||
|
||||
@@ -15,10 +15,6 @@ iD.ui.preset.localized = function(field, context) {
|
||||
.attr('class', 'localized-main')
|
||||
.attr('placeholder', field.placeholder());
|
||||
|
||||
input
|
||||
.on('blur', change)
|
||||
.on('change', change);
|
||||
|
||||
if (field.id === 'name') {
|
||||
var preset = context.presets().match(entity, context.graph());
|
||||
input.call(d3.combobox().fetcher(
|
||||
@@ -26,6 +22,10 @@ iD.ui.preset.localized = function(field, context) {
|
||||
));
|
||||
}
|
||||
|
||||
input
|
||||
.on('blur', change)
|
||||
.on('change', change);
|
||||
|
||||
var translateButton = selection.selectAll('.localized-add')
|
||||
.data([0]);
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ iD.ui.preset.maxspeed = function(field, context) {
|
||||
.attr('placeholder', field.placeholder());
|
||||
|
||||
input
|
||||
.call(combobox)
|
||||
.on('change', change)
|
||||
.on('blur', change)
|
||||
.call(combobox);
|
||||
.on('blur', change);
|
||||
|
||||
var childNodes = context.graph().childNodes(context.entity(entity.id)),
|
||||
loc = childNodes[~~(childNodes.length/2)].loc;
|
||||
|
||||
@@ -41,9 +41,9 @@ iD.ui.preset.wikipedia = function(field, context) {
|
||||
.value('English');
|
||||
|
||||
lang
|
||||
.call(langcombo)
|
||||
.on('blur', changeLang)
|
||||
.on('change', changeLang)
|
||||
.call(langcombo);
|
||||
.on('change', changeLang);
|
||||
|
||||
title = selection.selectAll('input.wiki-title')
|
||||
.data([0]);
|
||||
@@ -54,9 +54,9 @@ iD.ui.preset.wikipedia = function(field, context) {
|
||||
.attr('id', 'preset-input-' + field.id);
|
||||
|
||||
title
|
||||
.call(titlecombo)
|
||||
.on('blur', change)
|
||||
.on('change', change)
|
||||
.call(titlecombo);
|
||||
.on('change', change);
|
||||
|
||||
link = selection.selectAll('a.wiki-link')
|
||||
.data([0]);
|
||||
|
||||
Reference in New Issue
Block a user