mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Fix geometries detection in preset_fields.js
`renderDisclosureContent` in `preset_fields.js` tries to detect the geometry types of the selected entities, but the result is always `[]`. Reason: The handler of `_entityIDs.reduce` always returns `true`. So the result of the `reduce` call is `true` as well. `Object.keys(true)` results in `[]`. Fix: The handler of `_entityIDs.reduce` should return the map which collects the geometry types, so `geometries` will be be something like `["line", "vertex"]`.
This commit is contained in:
@@ -34,7 +34,8 @@ export function uiSectionPresetFields(context) {
|
||||
var graph = context.graph();
|
||||
|
||||
var geometries = Object.keys(_entityIDs.reduce(function(geoms, entityID) {
|
||||
return geoms[graph.entity(entityID).geometry(graph)] = true;
|
||||
geoms[graph.entity(entityID).geometry(graph)] = true;
|
||||
return geoms;
|
||||
}, {}));
|
||||
|
||||
var presetsManager = presetManager;
|
||||
|
||||
Reference in New Issue
Block a user