From 295db19ea01e73aef284364d6c1f2a370b46e394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 26 Jun 2017 22:39:51 +0200 Subject: [PATCH] Show details link --- index.js | 4 ++-- src/CategoryOverpass.js | 2 ++ style.css | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 19950bcf..a63a4c41 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,7 @@ window.onload = function() { var url = location.hash.substr(1) options = { - showDetails: false + showDetails: !!location.hash.match(/\/details$/) } show(url, options, function () {}) @@ -66,7 +66,7 @@ window.onload = function() { var url = loc.substr(1) options = { - showDetails: false + showDetails: !!loc.match(/\/details$/) } show(url, options, function () {}) diff --git a/src/CategoryOverpass.js b/src/CategoryOverpass.js index d46e6a95..80abe396 100644 --- a/src/CategoryOverpass.js +++ b/src/CategoryOverpass.js @@ -10,6 +10,8 @@ function CategoryOverpass (id, data) { data.id = this.id data.feature.appUrl = '#' + this.id + '/{{ id }}' + data.feature.body = (typeof data.feature.body === 'string' ? data.feature.body : '') + 'show details' + this.layer = new OverpassLayer(data) } diff --git a/style.css b/style.css index 45b9eccf..3f99be8c 100644 --- a/style.css +++ b/style.css @@ -182,3 +182,9 @@ ul.overpass-layer-list > li:after { width: 25px; text-align: center; } +#object a.showDetails { + display: none; +} +a.showDetails { + display: block; +}