Set title attribute for tag keys/values, ensure combo options have title

This will show values as hover tooltips, in case the field is too narrow and the value is cut off.
(closes #3054)
This commit is contained in:
Bryan Housel
2016-04-08 23:51:16 -04:00
parent 0759f17e87
commit a77e1b6606
2 changed files with 9 additions and 2 deletions

View File

@@ -44,12 +44,17 @@ iD.services.taginfo = function() {
return function(d) { return parseFloat(d.fraction) > 0.01 || d.in_wiki; }; return function(d) { return parseFloat(d.fraction) > 0.01 || d.in_wiki; };
} }
function valKey(d) { return { value: d.key }; } function valKey(d) {
return {
value: d.key,
title: d.key
};
}
function valKeyDescription(d) { function valKeyDescription(d) {
return { return {
value: d.value, value: d.value,
title: d.description title: d.description || d.value
}; };
} }

View File

@@ -100,11 +100,13 @@ iD.ui.RawTagEditor = function(context) {
}); });
$items.select('input.key') $items.select('input.key')
.attr('title', function(d) { return d.key; })
.value(function(d) { return d.key; }) .value(function(d) { return d.key; })
.on('blur', keyChange) .on('blur', keyChange)
.on('change', keyChange); .on('change', keyChange);
$items.select('input.value') $items.select('input.value')
.attr('title', function(d) { return d.value; })
.value(function(d) { return d.value; }) .value(function(d) { return d.value; })
.on('blur', valueChange) .on('blur', valueChange)
.on('change', valueChange) .on('change', valueChange)