Continue support for options array of keys

This commit is contained in:
Bryan Housel
2014-07-22 12:14:13 -04:00
parent af0be9a59b
commit 2b96064ed3
+7 -1
View File
@@ -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(', ') + '...'));
}