diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js index b5033d7f2..4d8910b1c 100644 --- a/js/id/ui/preset.js +++ b/js/id/ui/preset.js @@ -1,5 +1,6 @@ iD.ui.preset = function() { var event = d3.dispatch('change'), + taginfo = iD.taginfo(), hidden, sections, exttags, @@ -84,12 +85,19 @@ iD.ui.preset = function() { .attr('label', function(d) { return d; }); break; case 'combo': - var w = this.append('span').attr('class', 'input-wrap-position'); + var w = this.append('span').attr('class', 'input-wrap-position'), + combobox = d3.combobox(); i = w.append('input'); - w.call(d3.combobox() - .data([''].map(function(o) { - return { value: o, title: o }; - }))); + w.call(combobox); + taginfo.values({ + key: d.key + }, function(err, data) { + if (!err) combobox.data(data.map(function(d) { + d.title = d.value = d.value.replace('_', ' '); + return d; + })); + }); + break; } if (i) { diff --git a/presets/presets.json b/presets/presets.json index 8258ffa5e..0398aa6c0 100644 --- a/presets/presets.json +++ b/presets/presets.json @@ -15,6 +15,10 @@ "title": "Internet Access", "type": "select", "options": ["yes", "no", "wlan", "wired", "terminal"] + }, + { + "key": "cuisine", + "type": "combo" } ] },