mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-17 03:02:51 +00:00
Improve road features form, localize options
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"title": " ",
|
|
||||||
"type": "radio",
|
"type": "radio",
|
||||||
"options": [
|
"options": [
|
||||||
"bridge",
|
"bridge",
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ locale.en = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"roadtype": {
|
"roadtype": {
|
||||||
"label": "Road Type",
|
"label": "Features",
|
||||||
"options": {
|
"options": {
|
||||||
"bridge": "Bridge",
|
"bridge": "Bridge",
|
||||||
"tunnel": "Tunnel",
|
"tunnel": "Tunnel",
|
||||||
|
|||||||
Reference in New Issue
Block a user