mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Use newlines instead of semicolons to separate mutliselection tag values in tooltips (re: #7306)
This commit is contained in:
@@ -214,7 +214,7 @@ export function uiFieldAccess(field, context) {
|
||||
return tags[d] && Array.isArray(tags[d]);
|
||||
})
|
||||
.attr('title', function(d) {
|
||||
return tags[d] && Array.isArray(tags[d]) && tags[d].filter(Boolean).join('; ');
|
||||
return tags[d] && Array.isArray(tags[d]) && tags[d].filter(Boolean).join('\n');
|
||||
})
|
||||
.attr('placeholder', function(d) {
|
||||
if (tags[d] && Array.isArray(tags[d])) {
|
||||
|
||||
@@ -277,7 +277,7 @@ export function uiFieldAddress(field, context) {
|
||||
})
|
||||
.attr('title', function(subfield) {
|
||||
var val = tags[field.key + ':' + subfield.id];
|
||||
return val && Array.isArray(val) && val.filter(Boolean).join('; ');
|
||||
return val && Array.isArray(val) && val.filter(Boolean).join('\n');
|
||||
})
|
||||
.classed('mixed', function(subfield) {
|
||||
return Array.isArray(tags[field.key + ':' + subfield.id]);
|
||||
|
||||
@@ -551,7 +551,7 @@ export function uiFieldCombo(field, context) {
|
||||
}).filter(Boolean);
|
||||
|
||||
utilGetSetValue(input, !isMixed ? displayValue(tags[field.key]) : '')
|
||||
.attr('title', isMixed ? mixedValues.join('; ') : undefined)
|
||||
.attr('title', isMixed ? mixedValues.join('\n') : undefined)
|
||||
.attr('placeholder', isMixed ? t('inspector.multiple_values') : _staticPlaceholder || '')
|
||||
.classed('mixed', isMixed);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ export function uiFieldCycleway(field, context) {
|
||||
if (Array.isArray(tags[d])) {
|
||||
vals = vals.concat(tags[d]);
|
||||
}
|
||||
return vals.filter(Boolean).join('; ');
|
||||
return vals.filter(Boolean).join('\n');
|
||||
}
|
||||
return null;
|
||||
})
|
||||
|
||||
@@ -195,7 +195,7 @@ export function uiFieldText(field, context) {
|
||||
var isMixed = Array.isArray(tags[field.key]);
|
||||
|
||||
utilGetSetValue(input, !isMixed && tags[field.key] ? tags[field.key] : '')
|
||||
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('; ') : undefined)
|
||||
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined)
|
||||
.attr('placeholder', isMixed ? t('inspector.multiple_values') : (field.placeholder() || t('inspector.unknown')))
|
||||
.classed('mixed', isMixed);
|
||||
|
||||
|
||||
@@ -565,7 +565,7 @@ export function uiFieldLocalized(field, context) {
|
||||
return typeof d.value === 'string' ? d.value : '';
|
||||
})
|
||||
.attr('title', function(d) {
|
||||
return Array.isArray(d.value) ? d.value.filter(Boolean).join('; ') : null;
|
||||
return Array.isArray(d.value) ? d.value.filter(Boolean).join('\n') : null;
|
||||
})
|
||||
.attr('placeholder', function(d) {
|
||||
return Array.isArray(d.value) ? t('inspector.multiple_values') : t('translate.localized_translation_name');
|
||||
@@ -594,7 +594,7 @@ export function uiFieldLocalized(field, context) {
|
||||
var isMixed = Array.isArray(tags[field.key]);
|
||||
|
||||
utilGetSetValue(input, typeof tags[field.key] === 'string' ? tags[field.key] : '')
|
||||
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('; ') : undefined)
|
||||
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined)
|
||||
.attr('placeholder', isMixed ? t('inspector.multiple_values') : field.placeholder())
|
||||
.classed('mixed', isMixed);
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ export function uiFieldMaxspeed(field, context) {
|
||||
setUnitSuggestions();
|
||||
|
||||
utilGetSetValue(input, typeof value === 'string' ? value : '')
|
||||
.attr('title', isMixed ? value.filter(Boolean).join('; ') : null)
|
||||
.attr('title', isMixed ? value.filter(Boolean).join('\n') : null)
|
||||
.attr('placeholder', isMixed ? t('inspector.multiple_values') : field.placeholder())
|
||||
.classed('mixed', isMixed);
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ export function uiFieldTextarea(field, context) {
|
||||
var isMixed = Array.isArray(tags[field.key]);
|
||||
|
||||
utilGetSetValue(input, !isMixed && tags[field.key] ? tags[field.key] : '')
|
||||
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('; ') : undefined)
|
||||
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined)
|
||||
.attr('placeholder', isMixed ? t('inspector.multiple_values') : (field.placeholder() || t('inspector.unknown')))
|
||||
.classed('mixed', isMixed);
|
||||
};
|
||||
|
||||
@@ -286,7 +286,7 @@ export function uiFieldWikidata(field, context) {
|
||||
|
||||
var isMixed = Array.isArray(tags[field.key]);
|
||||
d3_select('li.wikidata-search input')
|
||||
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('; ') : null)
|
||||
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : null)
|
||||
.attr('placeholder', isMixed ? t('inspector.multiple_values') : '')
|
||||
.classed('mixed', isMixed);
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ export function uiRawTagEditor(context) {
|
||||
|
||||
items.selectAll('input.value')
|
||||
.attr('title', function(d) {
|
||||
return Array.isArray(d.value) ? d.value.filter(Boolean).join('; ') : d.value;
|
||||
return Array.isArray(d.value) ? d.value.filter(Boolean).join('\n') : d.value;
|
||||
})
|
||||
.classed('mixed', function(d) {
|
||||
return Array.isArray(d.value);
|
||||
|
||||
Reference in New Issue
Block a user