mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 15:56:56 +02:00
Continue support for options array of keys
This commit is contained in:
@@ -2,6 +2,7 @@ iD.ui.preset.combo =
|
||||
iD.ui.preset.typeCombo = function(field) {
|
||||
var event = d3.dispatch('change'),
|
||||
optstrings = field.strings && field.strings.options,
|
||||
optarray = field.options,
|
||||
strings = {},
|
||||
input;
|
||||
|
||||
@@ -28,6 +29,11 @@ iD.ui.preset.typeCombo = function(field) {
|
||||
strings[k] = field.t('options.' + k, { 'default': v });
|
||||
});
|
||||
stringsLoaded();
|
||||
} else if (optarray) {
|
||||
_.each(optarray, function(k) {
|
||||
strings[k] = k.replace(/_+/g, ' ');
|
||||
});
|
||||
stringsLoaded();
|
||||
} else {
|
||||
iD.taginfo().values({key: field.key}, function(err, data) {
|
||||
if (!err) {
|
||||
@@ -53,7 +59,7 @@ iD.ui.preset.typeCombo = function(field) {
|
||||
return o;
|
||||
}));
|
||||
|
||||
placeholders = strs.length ? strs : keys;
|
||||
placeholders = strs.length > 1 ? strs : keys;
|
||||
input.attr('placeholder', field.placeholder() ||
|
||||
(placeholders.slice(0, 3).join(', ') + '...'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user