|
|
|
@ -80,6 +80,21 @@ $("#app").on("sheet:close", "#package-info-sheet", function () {
|
|
|
|
|
$(".package-marker").removeClass("selected");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#app").on("click", "#package-info-sheet #package-info-deliver-all", function () {
|
|
|
|
|
var coordid = $(this).data("coordid");
|
|
|
|
|
for (var i = 0; i < packages.length; i++) {
|
|
|
|
|
if (packages[i].id == coordid) {
|
|
|
|
|
package = packages[i];
|
|
|
|
|
for (var j = 0; j < package.items.length; j++) {
|
|
|
|
|
markDelivered(package.items[j].id);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.updatePackageLayer(packages);
|
|
|
|
|
openPackageInfoSheet(coordid, true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function openPackageInfoSheet(coordid, refreshOnly) {
|
|
|
|
|
if (typeof refreshOnly == "undefined") {
|
|
|
|
|
refreshOnly = false;
|
|
|
|
@ -97,6 +112,7 @@ function openPackageInfoSheet(coordid, refreshOnly) {
|
|
|
|
|
|
|
|
|
|
$("#package-info-get-directions").attr("href", "geo:" + package.coords[0] + "," + package.coords[1]);
|
|
|
|
|
$("#package-info-sheet-inner .list ul").html("");
|
|
|
|
|
$("#package-info-deliver-all").data("coordid", coordid);
|
|
|
|
|
|
|
|
|
|
for (var j = 0; j < package.items.length; j++) {
|
|
|
|
|
var classes = "";
|
|
|
|
@ -118,9 +134,10 @@ function openPackageInfoSheet(coordid, refreshOnly) {
|
|
|
|
|
+ '</li>');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!refreshOnly) {
|
|
|
|
|
if (!refreshOnly) {
|
|
|
|
|
app.sheet.create({el: "#package-info-sheet"}).open();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|