X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/f8bbc22c15d1fae32c68ebcd0d0b61315ed5168b..b6dfa76c894233d61ada73de5b59901797e3b268:/src/handlebar_helpers.js?ds=sidebyside diff --git a/src/handlebar_helpers.js b/src/handlebar_helpers.js index 8970578..b40b11a 100644 --- a/src/handlebar_helpers.js +++ b/src/handlebar_helpers.js @@ -47,11 +47,22 @@ Handlebars.registerHelper({ if (!aFeature) return ''; if (!aFeature.place_id) return ''; - sTitle = 'details >'; - var sTitle = Handlebars.escapeExpression(sTitle); + sTitle = Handlebars.escapeExpression(sTitle || 'details >'); return new Handlebars.SafeString( - '' + (sTitle ? sTitle : aFeature.place_id ) + '' + '' + sTitle + '' + ); + }, + detailsPermaLink: function(aFeature, sTitle) { + if (!aFeature) return ''; + + var sOSMType = formatOSMType(aFeature.osm_type, false); + if (!sOSMType) return ''; + + sTitle = Handlebars.escapeExpression(sTitle || sOSMType + ' ' + aFeature.osm_id); + + return new Handlebars.SafeString( + '' + sTitle + '' ); }, coverageType: function(aPlace) {