diff --git a/www/assets/js/map_leaflet.js b/www/assets/js/map_leaflet.js index f65be0b..dd37b27 100644 --- a/www/assets/js/map_leaflet.js +++ b/www/assets/js/map_leaflet.js @@ -80,13 +80,14 @@ function leafletMap() { //console.log(iconName); var classes = "package-marker package-marker-leaflet"; - + // Prevent selection highlight from going away after map refresh if (map.openedPanelIconID != null && map.openedPanelIconID == datai.id) { classes += " selected"; } - // Show different color highlight when nearby - if (packages[i].distance * 1 < getStorage("alertradius") * 1) { + // Show different color highlight when nearby and undelivered + if (packages[i].distance * 1 < getStorage("alertradius") * 1 + && getUndeliveredCount(packages[i]) > 0) { classes += " alerted"; } var icon = L.icon({ diff --git a/www/assets/js/map_mapbox.js b/www/assets/js/map_mapbox.js index e2f853e..18d37da 100644 --- a/www/assets/js/map_mapbox.js +++ b/www/assets/js/map_mapbox.js @@ -110,8 +110,9 @@ function mapboxMap() { if (map.openedPanelIconID != null && map.openedPanelIconID == datai.id) { el.className += " selected"; } - // Show different color highlight when nearby - if (packages[i].distance * 1 < getStorage("alertradius") * 1) { + // Show different color highlight when nearby and undelivered + if (packages[i].distance * 1 < getStorage("alertradius") * 1 + && getUndeliveredCount(packages[i]) > 0) { el.className += " alerted"; } diff --git a/www/assets/js/packages.js b/www/assets/js/packages.js index 732e96b..33eb1c8 100644 --- a/www/assets/js/packages.js +++ b/www/assets/js/packages.js @@ -719,7 +719,7 @@ function addPackageByBarcode(barcode, type, callback) { ajaxlookup(); } } - + prelookup(); }