diff --git a/static/js/map.js b/static/js/map.js index e3ac8a247f525229be6077d7cc3b8d8133b109a2..e48570b10c58e08a6ea3de4197f291a5d7aac9d8 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -143,7 +143,7 @@ BusMap.Map = function(opts) { var route = that.routes[vehicles[v].route].title; var text = '<header>' + route + '</header>'; - var text_after = '<footer>Bus # ' + vehicles[v].vehicle + '</footer>'; + var footer = '<footer>Bus # ' + vehicles[v].vehicle + '</footer>'; var popupOpts = { closeButton: false, keepInView: true, @@ -161,7 +161,7 @@ BusMap.Map = function(opts) { noHide: true, direction: 'right', clickable: true, - }).bindPopup(text + text_after, popupOpts).addTo(that.vehicleMarkersGroup); + }).bindPopup(text + footer, popupOpts).addTo(that.vehicleMarkersGroup); } else { that.vehicleMarkers[v].setLatLng([vehicles[v].lat, vehicles[v].lon]) .setIconAngle(vehicles[v].heading); @@ -202,7 +202,7 @@ BusMap.Map = function(opts) { predictions.push("<div class='more'><a href='javascript:void(0);' onclick='$(this).hide().parent().parent().parent().addClass(\"show-all-predictions\");'>see more</a></div>"); } text += '<section class="predictions vehicle-predictions">' - + predictions.join("") + '</section>' + text_after; + + predictions.join("") + '</section>' + footer; that.vehicleMarkers[v]._popup.setContent(text); } }