diff options
author | Willi <willi@jups42.de> | 2012-12-01 21:15:02 +0100 |
---|---|---|
committer | Willi <willi@jups42.de> | 2012-12-01 21:15:02 +0100 |
commit | 48e03c07eff6ac5d19bbddfd53ebbc36738bd824 (patch) | |
tree | b8be3c7fd5c37ccab4f3590b41d89fcaa959c160 /resources | |
parent | 050b682b63097b930a0fcda2413b5e60b1adcb0e (diff) | |
download | health-map-48e03c07eff6ac5d19bbddfd53ebbc36738bd824.tar health-map-48e03c07eff6ac5d19bbddfd53ebbc36738bd824.tar.gz |
replaced jQuery events with leavelet ones
Diffstat (limited to 'resources')
-rw-r--r-- | resources/map.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/resources/map.js b/resources/map.js index a6828a6..1ecfe0a 100644 --- a/resources/map.js +++ b/resources/map.js @@ -2,19 +2,17 @@ $(document).ready(function() { var self = this; - self.template = _.template('<dl> <% _.each(properties, function(val, key) { %>\ + self.template = _.template('<dl> <% _.each(properties, function(val, key) { %> \ <% if (/\:/.exec(key)) { %> \ <dl> \ - <% console.log(key.split(":")); %>\ - <% console.log(val); %>\ <dt><%= key.split(":")[1] %> </dt> \ <dd><%= val %> </dd> \ </dl> \ <% } else {%> \ - <dt><%= key %> </dt>\ - <dd><%= val %> </dd>\ + <dt><%= key %> </dt> \ + <dd><%= val %> </dd> \ <% } %> \ - <% }); %>\ + <% }); %> \ </dl>'); fetchLayers(); @@ -31,7 +29,7 @@ $(document).ready(function() { $('.leaflet-control-layers-selector').first().trigger('click') } - $('body').bind('hospitalsfetched', addHospitalLayer); + map.on('hospitalsfetched', addHospitalLayer); map.on('locationfound', onLocationFound); map.on('locationerror', onLocationError); @@ -74,7 +72,7 @@ $(document).ready(function() { } }); self.hospitalLayer = layer; - $('body').trigger('hospitalsfetched'); + map.fireEvent('hospitalsfetched'); }); } |