]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/handlebar_helpers.js
Readme: use localhost, not 0.0.0.0 for copy&paste instruction
[nominatim-ui.git] / src / handlebar_helpers.js
index b4589ed5ad62318145b14c92fe120d1d839193c9..a1872f0a3c0ce751e50517b6872e8fd8e83366ad 100644 (file)
@@ -66,8 +66,13 @@ Handlebars.registerHelper({
 
     var sTitleEscaped = Handlebars.escapeExpression(sTitle || sOSMType + ' ' + aFeature.osm_id);
 
+    var sURL = 'details.html?osmtype=' + aFeature.osm_type + '&osmid=' + aFeature.osm_id;
+    if (aFeature.category) {
+      sURL = sURL + '&class=' + aFeature.category;
+    }
+
     return new Handlebars.SafeString(
-      '<a href="details.html?osmtype=' + aFeature.osm_type + '&osmid=' + aFeature.osm_id + '&class=' + aFeature.category + '">' + sTitleEscaped + '</a>'
+      '<a href="' + sURL + '">' + sTitleEscaped + '</a>'
     );
   },
   coverageType: function (aPlace) {