diff --git a/www/assets/js/list.js b/www/assets/js/list.js index 4b70cdf..311053f 100644 --- a/www/assets/js/list.js +++ b/www/assets/js/list.js @@ -15,9 +15,10 @@ $(".view-main").on("click", "#addresslist .package-list-item .directions-btn", f window.open($(this).attr("href"), "_system"); }); -$(".view-main").on("swipeout:delete", "#addresslist .package-list-item", function () { - console.log("Info", "Deleting package", $(this).data("packageid")); - deletePackage($(this).data("packageid")); +$(".view-main").on("click", "#addresslist .package-list-item .delete-btn", function () { + var id = $(this).parents(".package-list-item").data("packageid"); + console.log("Info", "Deleting package", id); + deletePackage(id); }); // Searchbar is setup in routes.js, this is for forcing a wider scope @@ -92,7 +93,7 @@ function loadPackageList(sortType) { }); - $("#addresslist").html(""); + $("#addresslist ul").html(""); if (packages.length == 0) { $("#no-packages-display").removeClass("display-none"); @@ -103,40 +104,66 @@ function loadPackageList(sortType) { for (var i = 0; i < sortedPackages.length; i++) { for (var j = 0; j < sortedPackages[i].value.items.length; j++) { var item = sortedPackages[i].value.items[j]; - var icon = getIconForType(item.type); + var icon1 = getIconForType(item.type); + var icon2 = ""; var classes = ""; var delivered = false; if (item.delivered) { delivered = true; - icon = "far fa-check-circle"; + icon2 = icon1; + icon1 = "far fa-check-circle fa-fw"; classes = "text-color-green"; } else if (typeof sortedPackages[i].value.distance != 'undefined' && sortedPackages[i].value.distance * 1 < getStorage("alertradius") * 1) { classes = "text-color-deeporange"; } - $("#addresslist").append( - '
  • ' - + '
    ' - + '
    ' - + ' ' - + '
    ' + $("#addresslist ul").append( + '
  • ' + + '' - + '
    ' - + ' ' + (delivered ? "  Undeliver" : "  Deliver") + '' - + ' directions' - + '
    ' - + '
    ' - + ' delete  Delete' + + '
    ' + + ' ' + + '
    ' + '
    ' + '
  • ' ); +// $("#addresslist").append( +// '
  • ' +// + '
    ' +// + '
    ' +// + ' ' +// + '
    ' +// + '
    ' +// + '
    ' +// + ' ' + item.address +// + '
    ' +// + ' ' +// + '
    ' +// + '
    ' +// + '
    ' +// + ' ' + (delivered ? "  Undeliver" : "  Deliver") + '' +// + ' directions' +// + '
    ' +// + '
    ' +// + ' delete  Delete' +// + '
    ' +// + '
  • ' +// ); } } diff --git a/www/pages/help/list.html b/www/pages/help/list.html index 0f29c82..e35bc6a 100644 --- a/www/pages/help/list.html +++ b/www/pages/help/list.html @@ -20,14 +20,11 @@
    Manage Items
    - Swipe left-to-right on a list entry + Tap or click on a list entry to show the actions you can take. - These actions are marking the item as delivered/undelivered, or - navigating to its location with your device's default maps app. -
    - Swipe right-to-left on a list entry - and tap - delete Delete to remove it. + These actions are marking the item as delivered/undelivered, + navigating to its location with your device's default maps app, + and deleting the item.
    Clear the List
    diff --git a/www/pages/list.html b/www/pages/list.html index a045121..fe41083 100644 --- a/www/pages/list.html +++ b/www/pages/list.html @@ -51,9 +51,11 @@
    Add a Package
    - +
    + +