mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Merge pull request #7932 from til-schneider/patch-1
Improve performance of raw tag editor
This commit is contained in:
@@ -124,7 +124,6 @@ export default {
|
||||
// {
|
||||
// key: 'string',
|
||||
// value: 'string',
|
||||
// rtype: 'string',
|
||||
// langCode: 'string'
|
||||
// }
|
||||
//
|
||||
@@ -133,7 +132,7 @@ export default {
|
||||
var that = this;
|
||||
var titles = [];
|
||||
var result = {};
|
||||
var rtypeSitelink = params.rtype ? ('Relation:' + params.rtype).replace(/_/g, ' ').trim() : false;
|
||||
var rtypeSitelink = (params.key === 'type' && params.value) ? ('Relation:' + params.value).replace(/_/g, ' ').trim() : false;
|
||||
var keySitelink = params.key ? this.toSitelink(params.key) : false;
|
||||
var tagSitelink = (params.key && params.value) ? this.toSitelink(params.key, params.value) : false;
|
||||
var localeSitelink;
|
||||
@@ -242,10 +241,6 @@ export default {
|
||||
// key: 'string', // required
|
||||
// value: 'string' // optional
|
||||
// }
|
||||
// -or-
|
||||
// {
|
||||
// rtype: 'rtype' // relation type (e.g. 'multipolygon')
|
||||
// }
|
||||
//
|
||||
// Get an result object used to display tag documentation
|
||||
// {
|
||||
|
||||
@@ -225,20 +225,11 @@ export function uiSectionRawTagEditor(id, context) {
|
||||
bindTypeahead(key, value);
|
||||
}
|
||||
|
||||
var reference;
|
||||
|
||||
if (typeof d.value !== 'string') {
|
||||
reference = uiTagReference({ key: d.key }, context);
|
||||
} else {
|
||||
var isRelation = _entityIDs && _entityIDs.some(function(entityID) {
|
||||
return context.entity(entityID).type === 'relation';
|
||||
});
|
||||
if (isRelation && d.key === 'type') {
|
||||
reference = uiTagReference({ rtype: d.value }, context);
|
||||
} else {
|
||||
reference = uiTagReference({ key: d.key, value: d.value }, context);
|
||||
}
|
||||
var referenceOptions = { key: d.key };
|
||||
if (typeof d.value === 'string') {
|
||||
referenceOptions.value = d.value;
|
||||
}
|
||||
var reference = uiTagReference(referenceOptions, context);
|
||||
|
||||
if (_state === 'hover') {
|
||||
reference.showing(false);
|
||||
|
||||
@@ -8,17 +8,13 @@ import { services } from '../services';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
|
||||
|
||||
// Pass `which` object of the form:
|
||||
// Pass `what` object of the form:
|
||||
// {
|
||||
// key: 'string', // required
|
||||
// value: 'string' // optional
|
||||
// }
|
||||
// -or-
|
||||
// {
|
||||
// rtype: 'string' // relation type (e.g. 'multipolygon')
|
||||
// }
|
||||
// -or-
|
||||
// {
|
||||
// qid: 'string' // brand wikidata (e.g. 'Q37158')
|
||||
// }
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user