Pretend oneway field is a oneway_yes field if junction=roundabout is set.

This commit is contained in:
Bryan Housel
2014-05-22 15:47:54 -04:00
parent e3e2ea602a
commit 8380981ac3
+10 -1
View File
@@ -1,5 +1,5 @@
iD.ui.preset.check =
iD.ui.preset.defaultcheck = function(field) {
iD.ui.preset.defaultcheck = function(field, context) {
var event = d3.dispatch('change'),
options = field.strings && field.strings.options,
values = [],
@@ -20,6 +20,15 @@ iD.ui.preset.defaultcheck = function(field) {
}
}
// hack: pretend oneway field is a oneway_yes field if `junction=roundabout` is set.
if (field.id === 'oneway') {
var way = context.entity(context.selectedIDs()[0]);
if (way.tags.junction === 'roundabout') {
texts.shift();
texts.unshift(t('presets.fields.oneway_yes.check.undefined', { 'default': 'Assumed to be Yes' }));
}
}
var check = function(selection) {
selection.classed('checkselect', 'true');