aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-12-02 13:48:29 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-12-02 13:48:29 +0000
commitba250309eb98e5956ca532b4823181745c9a9a55 (patch)
tree4b9afb80d53905fa6d753714309143626d35d8bf
parentc2e6cb5ed6e35c42659f10f7e5703798938335a6 (diff)
downloadhealth-map-ba250309eb98e5956ca532b4823181745c9a9a55.tar
health-map-ba250309eb98e5956ca532b4823181745c9a9a55.tar.gz
Replace the list in popups with a table
-rw-r--r--resources/map.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/resources/map.js b/resources/map.js
index b9edc79..6d00c2e 100644
--- a/resources/map.js
+++ b/resources/map.js
@@ -2,18 +2,21 @@ $(document).ready(function() {
var self = this;
- self.popupTemplate = _.template('<dl> <% _.each(properties, function(val, key) { %> \
+ self.popupTemplate = _.template('<table><tr><th>Key</th><th>Value</th></tr>\
+ <% _.each(properties, function(val, key) { %> \
<% if (/\:/.exec(key)) { %> \
- <dl> \
- <dt><%= key.split(":")[1] %> </dt> \
- <dd><%= val %> </dd> \
- </dl> \
+ <tr> \
+ <td><%= key.split(":")[1] %> </td> \
+ <td><%= val %> </td> \
+ </tr> \
<% } else {%> \
- <dt><%= key %> </dt> \
- <dd><%= val %> </dd> \
+ <tr>\
+ <td><%= key %> </td> \
+ <td><%= val %> </td> \
+ </tr>\
<% } %> \
<% }); %> \
- </dl>');
+ </table>');
// to filter them later
self.hospitalAttributes = [];