Followup changes to #7932

This commit is contained in:
Quincy Morgan
2020-09-03 14:00:30 -04:00
parent 087122a731
commit 8708c13f87
4 changed files with 5 additions and 15 deletions
+1 -10
View File
@@ -115,7 +115,7 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) {
};
_this.reference = (geom) => {
_this.reference = () => {
// Lookup documentation on Wikidata...
const qid = _this.tags.wikidata || _this.tags['brand:wikidata'] || _this.tags['operator:wikidata'];
if (qid) {
@@ -126,15 +126,6 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) {
let key = _this.originalReference.key || Object.keys(utilObjectOmit(_this.tags, 'name'))[0];
let value = _this.originalReference.value || _this.tags[key];
if (geom === 'relation' && key === 'type') {
if (value in _this.tags) {
key = value;
value = _this.tags[key];
} else {
return { rtype: value };
}
}
if (value === '*') {
return { key: key };
} else {
+1 -1
View File
@@ -425,7 +425,7 @@ export function uiPresetList(context) {
};
item.preset = preset;
item.reference = uiTagReference(preset.reference(entityGeometries()[0]), context);
item.reference = uiTagReference(preset.reference(), context);
return item;
}
+2 -3
View File
@@ -125,9 +125,8 @@ export function uiSectionFeatureType(context) {
if (!utilArrayIdentical(val, _presets)) {
_presets = val;
var geometries = entityGeometries();
if (_presets.length === 1 && geometries.length) {
_tagReference = uiTagReference(_presets[0].reference(geometries[0]), context)
if (_presets.length === 1) {
_tagReference = uiTagReference(_presets[0].reference(), context)
.showing(false);
}
}
+1 -1
View File
@@ -175,7 +175,7 @@ export function uiTagReference(what) {
tagReference.body = function(selection) {
var itemID = what.qid || what.rtype || (what.key + '-' + what.value);
var itemID = what.qid || (what.key + '-' + (what.value || ''));
_body = selection.selectAll('.tag-reference-body')
.data([itemID], function(d) { return d; });