mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-31 01:09:22 +02:00
Avoid resetting placeholder on every change
For some reason this invalidates and repaints the entire page.
This commit is contained in:
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user