mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-05 14:38:05 +02:00
Pretend oneway field is a oneway_yes field if junction=roundabout is set.
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user