mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
The additional fields dropdown now mixes universal and moreFields and is sorted alphabetically
This commit is contained in:
@@ -131,10 +131,6 @@ export function presetIndex() {
|
||||
});
|
||||
}
|
||||
|
||||
// move the wikidata field to directly follow the wikipedia field
|
||||
_universal.splice(_universal.indexOf(_fields.wikidata), 1);
|
||||
_universal.splice(_universal.indexOf(_fields.wikipedia)+1, 0, _fields.wikidata);
|
||||
|
||||
if (d.presets) {
|
||||
var rawPresets = d.presets;
|
||||
_forEach(d.presets, function(d, id) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
|
||||
import _union from 'lodash-es/union';
|
||||
import {
|
||||
event as d3_event,
|
||||
select as d3_select
|
||||
@@ -53,16 +53,13 @@ export function uiPresetEditor(context) {
|
||||
);
|
||||
}
|
||||
|
||||
_preset.moreFields.forEach(function(field) {
|
||||
if (_preset.fields.indexOf(field) === -1) {
|
||||
_fieldsArr.push(
|
||||
uiField(context, field, entity, { show: false })
|
||||
);
|
||||
}
|
||||
var additionalFields = _union(_preset.moreFields, presets.universal());
|
||||
additionalFields.sort(function(field1, field2) {
|
||||
return field1.label() > field2.label();
|
||||
});
|
||||
|
||||
presets.universal().forEach(function(field) {
|
||||
if (_preset.fields.indexOf(field) === -1 && _preset.moreFields.indexOf(field) === -1) {
|
||||
additionalFields.forEach(function(field) {
|
||||
if (_preset.fields.indexOf(field) === -1) {
|
||||
_fieldsArr.push(
|
||||
uiField(context, field, entity, { show: false })
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user