Avoid resetting placeholder on every change

For some reason this invalidates and repaints the
entire page.
This commit is contained in:
John Firebaugh
2013-06-19 15:43:44 -07:00
parent 83a4acdb4b
commit 63d9b36355

View File

@@ -10,23 +10,24 @@ 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)
.each(function() {
if (field.options) {
options(field.options);
} else {
iD.taginfo().values({
key: field.key
}, function(err, data) {
if (!err) options(_.pluck(data, 'value'));
});
}
});
input
.on('change', change)
.on('blur', change)
.call(combobox);
if (field.options) {
options(field.options);
} else {
iD.taginfo().values({
key: field.key
}, function(err, data) {
if (!err) options(_.pluck(data, 'value'));
});
}
function options(opts) {
combobox.data(opts.map(function(d) {
var o = {};