mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 15:08:23 +02:00
Fix inline tag help for fields that handle multiple tags
Some preset fields like the access-restriction field manage multiple tags at once (access=*, foot=*, bicycle=*, …). Then iD wasn't able to show inline help when clicking the ⓘ button. This introduces a new parameter for these kind of fields: `referenceKey` determines the tag key which should be used to search taginfo documentation for. Fixes #2222.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
"bicycle",
|
||||
"horse"
|
||||
],
|
||||
"referenceKey": "access",
|
||||
"type": "access",
|
||||
"label": "Access",
|
||||
"placeholder": "Unknown",
|
||||
@@ -65,6 +66,7 @@
|
||||
"addr:city",
|
||||
"addr:postcode"
|
||||
],
|
||||
"referenceKey": "addr",
|
||||
"icon": "address",
|
||||
"universal": true,
|
||||
"label": "Address",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"keys": ["access", "foot", "motor_vehicle", "bicycle", "horse"],
|
||||
"referenceKey": "access",
|
||||
"type": "access",
|
||||
"label": "Access",
|
||||
"placeholder": "Unknown",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"addr:city",
|
||||
"addr:postcode"
|
||||
],
|
||||
"referenceKey": "addr",
|
||||
"icon": "address",
|
||||
"universal": true,
|
||||
"label": "Address",
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"referenceKey": {
|
||||
"description": "Tag key which should be used to get taginfo documentation for (to be used when a field manages multiple tags)",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Type of field",
|
||||
"type": "string",
|
||||
|
||||
+2
-1
@@ -134,7 +134,8 @@ iD.ui.preset = function(context) {
|
||||
return field.present();
|
||||
})
|
||||
.each(function(field) {
|
||||
var reference = iD.ui.TagReference({key: field.key});
|
||||
var key = field.referenceKey || field.key,
|
||||
reference = iD.ui.TagReference({key: key});
|
||||
|
||||
if (state === 'hover') {
|
||||
reference.showing(false);
|
||||
|
||||
Reference in New Issue
Block a user