Apply JavaScript rule to use the dot notation

We were using the dot notation in most places, but not everywhere.
This commit is contained in:
Javi Martín
2019-07-03 02:32:47 +02:00
parent 25bfd01e69
commit af6a494344
6 changed files with 14 additions and 13 deletions

View File

@@ -75,7 +75,7 @@
};
openMarkerPopup = function(e) {
marker = e.target;
$.ajax("/investments/" + marker.options["id"] + "/json_data", {
$.ajax("/investments/" + marker.options.id + "/json_data", {
type: "GET",
dataType: "json",
success: function(data) {
@@ -84,7 +84,7 @@
});
};
getPopupContent = function(data) {
return "<a href='/budgets/" + data["budget_id"] + "/investments/" + data["investment_id"] + "'>" + data["investment_title"] + "</a>";
return "<a href='/budgets/" + data.budget_id + "/investments/" + data.investment_id + "'>" + data.investment_title + "</a>";
};
mapCenterLatLng = new L.LatLng(mapCenterLatitude, mapCenterLongitude);
map = L.map(element.id).setView(mapCenterLatLng, zoom);
@@ -103,7 +103,7 @@
addMarkerInvestments.forEach(function(coordinates) {
if (App.Map.validCoordinates(coordinates)) {
marker = createMarker(coordinates.lat, coordinates.long);
marker.options["id"] = coordinates.investment_id;
marker.options.id = coordinates.investment_id;
marker.on("click", openMarkerPopup);
}
});