mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Nicen favorite preset mode button tooltips
This commit is contained in:
@@ -25,6 +25,14 @@ en:
|
||||
title: Note
|
||||
description: "Spotted an issue? Let other mappers know."
|
||||
tail: Click on the map to add a note.
|
||||
add_preset:
|
||||
title: "Add {feature}"
|
||||
point:
|
||||
title: "Add {feature} as a point"
|
||||
line:
|
||||
title: "Add {feature} as a line"
|
||||
area:
|
||||
title: "Add {feature} as an area"
|
||||
browse:
|
||||
title: Browse
|
||||
description: Pan and zoom the map.
|
||||
|
||||
12
dist/locales/en.json
vendored
12
dist/locales/en.json
vendored
@@ -31,6 +31,18 @@
|
||||
"description": "Spotted an issue? Let other mappers know.",
|
||||
"tail": "Click on the map to add a note."
|
||||
},
|
||||
"add_preset": {
|
||||
"title": "Add {feature}",
|
||||
"point": {
|
||||
"title": "Add {feature} as a point"
|
||||
},
|
||||
"line": {
|
||||
"title": "Add {feature} as a line"
|
||||
},
|
||||
"area": {
|
||||
"title": "Add {feature} as an area"
|
||||
}
|
||||
},
|
||||
"browse": {
|
||||
"title": "Browse",
|
||||
"description": "Pan and zoom the map."
|
||||
|
||||
@@ -103,12 +103,19 @@ export function uiModes(context) {
|
||||
var markerClass = 'add-favorite add-preset-' + preset.name()
|
||||
.replace(/\s+/g, '_')
|
||||
+ '-' + d.geom; //replace spaces with underscores to avoid css interpretation
|
||||
|
||||
var presetName = t('presets.presets.' + preset.id + '.name');
|
||||
var relevantMatchingGeometry = preset.geometry.filter(function(geometry) {
|
||||
return ['point', 'line', 'area'].indexOf(geometry) !== -1;
|
||||
});
|
||||
var tooltipTitleID = 'modes.add_preset.title';
|
||||
if (relevantMatchingGeometry.length !== 1) {
|
||||
tooltipTitleID = 'modes.add_preset.' + d.geom + '.title'
|
||||
}
|
||||
var favoriteMode = {
|
||||
id: markerClass,
|
||||
button: markerClass,
|
||||
title: t('presets.presets.' + preset.id + '.name'),
|
||||
description: [t('operations.add.title'), t('presets.presets.' + preset.id + '.name'), t('geometry.' + d.geom)].join(' '),
|
||||
title: presetName,
|
||||
description: t(tooltipTitleID, { feature: presetName }),
|
||||
key: '',
|
||||
icon: icon,
|
||||
preset: preset,
|
||||
|
||||
Reference in New Issue
Block a user