mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Fix issues with wikidata field searching and label updating
This commit is contained in:
@@ -85,8 +85,12 @@ export default {
|
||||
|
||||
|
||||
languagesToQuery: function() {
|
||||
var localeCode = localizer.localeCode().toLowerCase();
|
||||
// HACK: en-us isn't a wikidata language. We should really be filtering by
|
||||
// the languages known to be supported by wikidata.
|
||||
if (localeCode === 'en-us') localeCode = 'en';
|
||||
return utilArrayUniq([
|
||||
localizer.localeCode().toLowerCase(),
|
||||
localeCode,
|
||||
localizer.languageCode().toLowerCase(),
|
||||
'en'
|
||||
]);
|
||||
|
||||
@@ -68,14 +68,12 @@ export function uiFieldWikidata(field, context) {
|
||||
.append('li')
|
||||
.attr('class', 'wikidata-search');
|
||||
|
||||
_searchInput = searchRowEnter
|
||||
searchRowEnter
|
||||
.append('input')
|
||||
.attr('type', 'text')
|
||||
.attr('id', field.domId)
|
||||
.style('flex', '1')
|
||||
.call(utilNoAuto);
|
||||
|
||||
_searchInput
|
||||
.call(utilNoAuto)
|
||||
.on('focus', function() {
|
||||
var node = d3_select(this).node();
|
||||
node.setSelectionRange(0, node.value.length);
|
||||
@@ -103,6 +101,10 @@ export function uiFieldWikidata(field, context) {
|
||||
if (_wikiURL) window.open(_wikiURL, '_blank');
|
||||
});
|
||||
|
||||
searchRow = searchRow.merge(searchRowEnter);
|
||||
|
||||
_searchInput = searchRow.select('input');
|
||||
|
||||
var wikidataProperties = ['description', 'identifier'];
|
||||
|
||||
var items = list.selectAll('li.labeled-input')
|
||||
|
||||
Reference in New Issue
Block a user