mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Add code so tunnel=building_passage doesn't default to layer=-1
(closes #4516)
This commit is contained in:
@@ -203,10 +203,22 @@ export function uiFieldRadio(field, context) {
|
||||
}
|
||||
|
||||
if (field.type === 'structureRadio') {
|
||||
if (val === 'no' || (key !== 'bridge' && key !== 'tunnel')) {
|
||||
// remove layer if it should not be set
|
||||
if (val === 'no' ||
|
||||
(key !== 'bridge' && key !== 'tunnel') ||
|
||||
(key === 'tunnel' && val === 'building_passage')) {
|
||||
t.layer = undefined;
|
||||
}
|
||||
}
|
||||
// add layer if it should be set
|
||||
if (t.layer === undefined) {
|
||||
if (key === 'bridge' && val !== 'no') {
|
||||
t.layer = '1';
|
||||
}
|
||||
if (key === 'tunnel' && val !== 'no' && val !== 'building_passage') {
|
||||
t.layer = '-1';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dispatch.call('change', this, t, onInput);
|
||||
}
|
||||
@@ -243,7 +255,7 @@ export function uiFieldRadio(field, context) {
|
||||
if (field.type === 'structureRadio') {
|
||||
if (activeKey === 'bridge') {
|
||||
t.layer = '1';
|
||||
} else if (activeKey === 'tunnel') {
|
||||
} else if (activeKey === 'tunnel' && t.tunnel !== 'building_passage') {
|
||||
t.layer = '-1';
|
||||
} else {
|
||||
t.layer = undefined;
|
||||
|
||||
Reference in New Issue
Block a user