mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-26 01:47:49 +02:00
Added "moreFields" property to the field schema
The "Add field" dropdown can now be used to add preset-specific fields in addition to universal fields
This commit is contained in:
@@ -10,6 +10,7 @@ export function presetPreset(id, preset, fields) {
|
||||
|
||||
preset.id = id;
|
||||
preset.fields = (preset.fields || []).map(getFields);
|
||||
preset.moreFields = (preset.moreFields || []).map(getFields);
|
||||
preset.geometry = (preset.geometry || []);
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export function uiPresetEditor(context) {
|
||||
);
|
||||
}
|
||||
|
||||
presets.universal().forEach(function(field) {
|
||||
_preset.moreFields.forEach(function(field) {
|
||||
if (_preset.fields.indexOf(field) === -1) {
|
||||
_fieldsArr.push(
|
||||
uiField(context, field, entity, { show: false })
|
||||
@@ -61,6 +61,14 @@ export function uiPresetEditor(context) {
|
||||
}
|
||||
});
|
||||
|
||||
presets.universal().forEach(function(field) {
|
||||
if (_preset.fields.indexOf(field) === -1 && _preset.moreFields.indexOf(field) === -1) {
|
||||
_fieldsArr.push(
|
||||
uiField(context, field, entity, { show: false })
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
_fieldsArr.forEach(function(field) {
|
||||
field
|
||||
.on('change', function(t, onInput) {
|
||||
|
||||
Reference in New Issue
Block a user