Set combobox data on update selection

A new combobox object is created on every render, while
previously the data was set only on the enter selection,
leaving it empty in most cases.

Fixes #1679
Fixes #1680
This commit is contained in:
John Firebaugh
2013-08-10 10:51:53 -07:00
parent 281899e333
commit 800b6b5462
+6 -6
View File
@@ -10,7 +10,11 @@ iD.ui.preset.combo = function(field) {
input.enter().append('input')
.attr('type', 'text')
.attr('id', 'preset-input-' + field.id)
.attr('id', 'preset-input-' + field.id);
input
.on('change', change)
.on('blur', change)
.each(function() {
if (field.options) {
options(field.options);
@@ -21,11 +25,7 @@ iD.ui.preset.combo = function(field) {
if (!err) options(_.pluck(data, 'value'));
});
}
});
input
.on('change', change)
.on('blur', change)
})
.call(combobox);
function options(opts) {