diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2014-03-01 18:29:12 +0000 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2014-03-01 18:29:12 +0000 |
commit | a06710fc33672ea224e5118198c7162109c528fb (patch) | |
tree | 39d53c9f084d3cfc34759e12dd517a691518a10d /src | |
parent | e60277f767cdab133f0c77e20298b58740c9b9f2 (diff) | |
download | leaflet-soton-a06710fc33672ea224e5118198c7162109c528fb.tar leaflet-soton-a06710fc33672ea224e5118198c7162109c528fb.tar.gz |
Fix workstation icon on the rooms
Diffstat (limited to 'src')
-rw-r--r-- | src/leaflet-soton.css | 6 | ||||
-rw-r--r-- | src/leaflet-soton.js | 24 |
2 files changed, 27 insertions, 3 deletions
diff --git a/src/leaflet-soton.css b/src/leaflet-soton.css index 2bf18c2..a464a5f 100644 --- a/src/leaflet-soton.css +++ b/src/leaflet-soton.css @@ -32,6 +32,12 @@ font-size: 23px; } +.ls-workstationicon-small { + width: 32px; + height: 32px; + text-align: center; +} + #ls-dynamicContentWrapper { background: white; min-height: 100%; diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index f90256d..08f29b2 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -484,11 +484,29 @@ SELECT * WHERE {\ if (partWorkstation) { if (partWorkstation.feature in workstationData) { - var workstationIcon = '<div class="ls-workstationicon" style="margin-left: auto; margin-right: auto; background-image: url(' + LS.imagePath + 'workstation-group.png' + ')"><div style="padding-left: 26px;">'; + var state = workstationData[partWorkstation.feature]; - var freeSeats = workstationData[partWorkstation.feature].free_seats; + var closed = (state.status.indexOf("closed") !== -1) - workstationIcon += freeSeats + "</div></div>"; + var image; + var workstationIcon; + + if (!closed) { + image = 'workstation-group.png'; + workstationIcon = '<div class="ls-workstationicon" style="margin-left: auto; margin-right: auto; background-image: url(' + LS.imagePath + image + ')">'; + } else { + image = 'workstation-closed.png'; + workstationIcon = '<div class="ls-workstationicon-small" style="margin-left: auto; margin-right: auto; background-image: url(' + LS.imagePath + image + ')">'; + } + + if (!closed) { + workstationIcon += '<div style="padding-left: 26px;">'; + + var freeSeats = state.free_seats; + workstationIcon += freeSeats + "</div>"; + } + + workstationIcon += '</div>'; content = workstationIcon + content; } else { |