Improve road features form, localize options

This commit is contained in:
John Firebaugh
2013-03-12 17:38:08 -07:00
parent 2b1b9a9f0b
commit 76ab27ae4c
3 changed files with 4 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
{ {
"title": " ",
"type": "radio", "type": "radio",
"options": [ "options": [
"bridge", "bridge",

View File

@@ -1,23 +1,22 @@
iD.ui.preset.radio = function(form) { iD.ui.preset.radio = function(form) {
var event = d3.dispatch('change', 'close'), var event = d3.dispatch('change', 'close'),
buttons, buttons;
input;
function radio(selection) { function radio(selection) {
selection.classed('preset-radio', true); selection.classed('preset-radio', true);
buttons = selection.selectAll('button') buttons = selection.selectAll('button')
.data(form.options) .data(form.options)
.enter() .enter()
.append('button') .append('button')
.text(function(d) { return d; }) .text(function(d) { return form.t('options.' + d, {default: d}); })
.on('click', function() { .on('click', function() {
buttons.classed('active', false); buttons.classed('active', false);
d3.select(this).classed('active', true); d3.select(this).classed('active', true);
change(); change();
}); });
selection.append('button') selection.append('button')
.on('click', function() { .on('click', function() {
buttons.classed('active', false); buttons.classed('active', false);

View File

@@ -382,7 +382,7 @@ locale.en = {
} }
}, },
"roadtype": { "roadtype": {
"label": "Road Type", "label": "Features",
"options": { "options": {
"bridge": "Bridge", "bridge": "Bridge",
"tunnel": "Tunnel", "tunnel": "Tunnel",