diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2014-09-27 15:16:12 +0100 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2014-09-27 15:16:12 +0100 |
commit | 1148eeac36048f84740004a2dbc3f1e15a39cc6b (patch) | |
tree | 51d60b1128decd84700c125bbdd2d6c4c60e3589 /src | |
parent | fbf4f7e0001fe6ae3f2ac6aee929f71eb1161912 (diff) | |
download | leaflet-soton-1148eeac36048f84740004a2dbc3f1e15a39cc6b.tar leaflet-soton-1148eeac36048f84740004a2dbc3f1e15a39cc6b.tar.gz |
Rework the building popups
Swap round the link to URI and locate functionality. The primary purpose of the
list of things in a building is to jump to that location in the building, when
that is not possible, a link to the URI is provided.
This also removes the very small target icons.
Diffstat (limited to 'src')
-rw-r--r-- | src/leaflet-soton.js | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index d3b0e4d..2d96f97 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -1355,14 +1355,13 @@ SELECT * WHERE {\ var content = document.createElement( 'div' ); content_ids.forEach(function(thing_id) { var info = set[thing_id]; - var div = document.createElement( 'div' ); - var html = "<a title='click for more information' href='"+info.uri+"'>"+info.label+"</a>"; - div.innerHTML = html; - if( info.geo ) { - div.appendChild( document.createTextNode( ' ' ) ); - var locate_link = createLink('#', false, div); - - locate_link.onclick = function() { + var div = document.createElement('div'); + + if (info.geo) { + var link = createLink('#', false, div); + link.textContent = info.label + + link.onclick = function() { var feature = LS.getFeatureByURI(info.uri); close(); @@ -1383,11 +1382,22 @@ SELECT * WHERE {\ map.showFeaturePopup(feature, latlng, options); } }; + } else { + var span = document.createElement("span"); + span.textContent = info.label + " "; + + div.appendChild(span); + + var link = document.createElement('a'); + link.setAttribute('href', info.uri); + link.setAttribute('target', '_blank'); + link.className = 'ls-popup-uri'; + link.textContent = "(Full Information)"; - locate_link.innerHTML = ' <span title="Show this on map" class="glyphicon glyphicon-screenshot">\u2316</span>'; + div.appendChild(link); } - content.appendChild( div ); + content.appendChild(div); }); return content; } |