mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 22:48:10 +02:00
Add tooltips to mixed values in semicombo, multicombo, and radio fields
This commit is contained in:
@@ -555,6 +555,7 @@ en:
|
||||
key_value: "key=value"
|
||||
multiple_values: Multiple Values
|
||||
multiple_types: Multiple Types
|
||||
unshared_value_tooltip: not shared by all features
|
||||
hidden_preset:
|
||||
manual: "{features} are hidden. Enable them in the Map Data pane."
|
||||
zoom: "{features} are hidden. Zoom in to enable them."
|
||||
|
||||
Vendored
+1
@@ -694,6 +694,7 @@
|
||||
"key_value": "key=value",
|
||||
"multiple_values": "Multiple Values",
|
||||
"multiple_types": "Multiple Types",
|
||||
"unshared_value_tooltip": "not shared by all features",
|
||||
"hidden_preset": {
|
||||
"manual": "{features} are hidden. Enable them in the Map Data pane.",
|
||||
"zoom": "{features} are hidden. Zoom in to enable them."
|
||||
|
||||
@@ -526,6 +526,9 @@ export function uiFieldCombo(field, context) {
|
||||
.classed('draggable', allowDragAndDrop)
|
||||
.classed('mixed', function(d) {
|
||||
return d.isMixed;
|
||||
})
|
||||
.attr('title', function(d) {
|
||||
return d.isMixed ? t('inspector.unshared_value_tooltip') : null;
|
||||
});
|
||||
|
||||
if (allowDragAndDrop) {
|
||||
|
||||
@@ -272,6 +272,13 @@ export function uiFieldRadio(field, context) {
|
||||
return !!(typeof tags[d] === 'string' && tags[d].toLowerCase() !== 'no');
|
||||
});
|
||||
|
||||
function isMixed(d) {
|
||||
if (field.key) {
|
||||
return Array.isArray(tags[field.key]) && tags[field.key].includes(d);
|
||||
}
|
||||
return Array.isArray(tags[d]);
|
||||
}
|
||||
|
||||
labels
|
||||
.classed('active', function(d) {
|
||||
if (field.key) {
|
||||
@@ -280,11 +287,9 @@ export function uiFieldRadio(field, context) {
|
||||
}
|
||||
return Array.isArray(tags[d]) || !!(tags[d] && tags[d].toLowerCase() !== 'no');
|
||||
})
|
||||
.classed('mixed', function(d) {
|
||||
if (field.key) {
|
||||
return Array.isArray(tags[field.key]) && tags[field.key].includes(d);
|
||||
}
|
||||
return Array.isArray(tags[d]);
|
||||
.classed('mixed', isMixed)
|
||||
.attr('title', function(d) {
|
||||
return isMixed(d) ? t('inspector.unshared_value_tooltip') : null;
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user