mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
Allow presets to inherit multiCombo and semiCombo fields even if they define the preset
This commit is contained in:
@@ -25,10 +25,14 @@ export function presetPreset(id, preset, fields, visible, rawPresets) {
|
||||
|
||||
// Skip `fields` for the keys which define the preset.
|
||||
// These are usually `typeCombo` fields like `shop=*`
|
||||
function withoutKeyFields(fieldID) {
|
||||
function shouldInheritFieldWithID(fieldID) {
|
||||
var f = fields[fieldID];
|
||||
if (f.key) {
|
||||
return preset.tags[f.key] === undefined;
|
||||
if (preset.tags[f.key] !== undefined &&
|
||||
// inherit anyway if multiple values are allowed
|
||||
f.type !== 'multiCombo' && f.type !== 'semiCombo') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -43,7 +47,7 @@ export function presetPreset(id, preset, fields, visible, rawPresets) {
|
||||
var inheritFieldIDs = inheritPreset[prop] || [];
|
||||
|
||||
if (prop === 'fields') {
|
||||
inheritFieldIDs = inheritFieldIDs.filter(withoutKeyFields);
|
||||
inheritFieldIDs = inheritFieldIDs.filter(shouldInheritFieldWithID);
|
||||
}
|
||||
|
||||
return inheritFieldIDs;
|
||||
|
||||
Reference in New Issue
Block a user