mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-29 07:06:04 +02:00
ea9e3008a5
This avoids overriding the `addTags` and `removeTags` objects with functions
13 lines
431 B
JavaScript
13 lines
431 B
JavaScript
export function actionChangePreset(entityID, oldPreset, newPreset) {
|
|
return function action(graph) {
|
|
var entity = graph.entity(entityID);
|
|
var geometry = entity.geometry(graph);
|
|
var tags = entity.tags;
|
|
|
|
if (oldPreset) tags = oldPreset.unsetTags(tags, geometry);
|
|
if (newPreset) tags = newPreset.setTags(tags, geometry);
|
|
|
|
return graph.replace(entity.update({tags: tags}));
|
|
};
|
|
}
|