From 3d4e61b9bf577b1af1edb87721f8d6a3ce39ac35 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 12 Mar 2015 15:23:08 +0000 Subject: Combine the full information and title for popups This saves vital vertical space on devices with smaller screens. --- src/leaflet-soton.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/leaflet-soton.js') diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index 6116704..238a921 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -1638,23 +1638,22 @@ SELECT * WHERE {\ } if ('name' in properties) { - var span = document.createElement( "span" ); - span.classList.add("ls-popup-title-name"); - span.textContent = properties.name; - title.appendChild( span ); - } + if ('uri' in properties) { + var link = document.createElement('a'); + link.setAttribute('href', properties.uri); + link.className = 'ls-popup-title-name'; - if ('uri' in properties) { - var link = document.createElement('a'); - link.setAttribute('href', properties.uri); - link.setAttribute('target', '_blank'); - link.className = 'ls-popup-uri'; - link.textContent = "(Full Information)"; + link.textContent = properties.name; - documentFragment.appendChild(link); + title.appendChild(link); + } else { + var span = document.createElement( "span" ); + span.classList.add("ls-popup-title-name"); + span.textContent = properties.name; + title.appendChild( span ); + } } - var div_inner = document.createElement("div"); div_inner.classList.add("ls-popup-content"); contentFunction(div_inner); -- cgit v1.2.3