From 0d0c5c5fe387cfe1a71b1620f6a73243f053a1d3 Mon Sep 17 00:00:00 2001 From: Samarth Agarwal Date: Fri, 29 Mar 2019 16:40:11 -0400 Subject: Changed null to undefined. --- web/public/javascripts/map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/public/javascripts') diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js index 33b0ed6..abb988a 100644 --- a/web/public/javascripts/map.js +++ b/web/public/javascripts/map.js @@ -42,7 +42,7 @@ function plotPointsOnMap(points) { // show details about point // e is the event info function showDetails(e) { - if(currPoint !== null) { + if(currPoint !== undefined) { if (currPoint.feature.geometry.status === "new") { currPoint._icon.src = '../assets/blue-icon.png'; } -- cgit v1.2.3 From 104e885981dec31aff9a5aaacc3abe2debcc9eba Mon Sep 17 00:00:00 2001 From: Samarth Agarwal Date: Fri, 29 Mar 2019 16:59:30 -0400 Subject: Merging. --- web/public/javascripts/map.js | 6 ------ 1 file changed, 6 deletions(-) (limited to 'web/public/javascripts') diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js index abb988a..c5b1583 100644 --- a/web/public/javascripts/map.js +++ b/web/public/javascripts/map.js @@ -24,12 +24,6 @@ function plotPointsOnMap(points) { pointToLayer: function (feature, latlng) { //return L.circleMarker(latlng); latlngbounds.extend(latlng); - if (feature.status === "pending") { - return L.marker(latlng, {icon: orangeIcon}); - } - else if (feature.status === "new") { - return L.marker(latlng); - } } }).on('click', showDetails).addTo(map); -- cgit v1.2.3 From d0259d4d2008afc5db87d8bd2b1705ee9c38e84a Mon Sep 17 00:00:00 2001 From: Samarth Agarwal Date: Fri, 29 Mar 2019 17:33:36 -0400 Subject: Finished merge --- web/public/javascripts/map.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'web/public/javascripts') diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js index 3cd5821..98e046b 100644 --- a/web/public/javascripts/map.js +++ b/web/public/javascripts/map.js @@ -128,6 +128,9 @@ function markAsPending(e) { let currPointId = currPointDetails._id; if (currPointDetails.status === "pending") return; + currPoint._icon.src = '../assets/orange-icon-focused.png'; + currPointDetails.status = "pending"; + updatePointStatusInDb(currPointId, "pending") .then(function(responseJson) { alert("Your change has been saved."); -- cgit v1.2.3 From 472739642a90f43970dc85ad37277f5124b8d797 Mon Sep 17 00:00:00 2001 From: Samarth Agarwal Date: Fri, 29 Mar 2019 18:48:14 -0400 Subject: Added undef line --- web/public/javascripts/map.js | 1 + 1 file changed, 1 insertion(+) (limited to 'web/public/javascripts') diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js index c5b1583..07ca190 100644 --- a/web/public/javascripts/map.js +++ b/web/public/javascripts/map.js @@ -125,6 +125,7 @@ function markAsPending(e) { function markAsCompleted(e) { map.removeLayer(currPoint); currPoint.feature.geometry.status = "completed"; + currPoint = undefined; } function closeDetails(e) { -- cgit v1.2.3 From d727ca868539d6fd69b0a0dae673c11f0653f92e Mon Sep 17 00:00:00 2001 From: Samarth Agarwal Date: Fri, 29 Mar 2019 18:59:02 -0400 Subject: Changed pic url for pending clicks. --- web/public/javascripts/map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/public/javascripts') diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js index 6f06e40..5326bb2 100644 --- a/web/public/javascripts/map.js +++ b/web/public/javascripts/map.js @@ -134,7 +134,7 @@ function markAsPending(e) { updatePointStatusInDb(currPointId, "pending") .then(function(responseJson) { alert("Your change has been saved."); - currPoint._icon.src = '../assets/orange-icon.png'; + currPoint._icon.src = '../assets/orange-icon-focused.png'; }) .catch(function(error) { alert(error); -- cgit v1.2.3