Fix sortable for modern browsers. 2021-09-17
authorIain Patterson <me@iain.cx>
Fri, 17 Sep 2021 07:03:58 +0000 (03:03 -0400)
committerIain Patterson <me@iain.cx>
Fri, 17 Sep 2021 07:06:37 +0000 (03:06 -0400)
lib/delivery.php
lib/header.php
www/jquery.sortable.js
www/style.css

index 6d7643b..006112c 100644 (file)
     }
 
     if ($count > 1) {
-      echo "<div class=\"sortable\">\n";
       echo "<p class=\"noprint\">Drag delivery details to reorder the schedule.</p>\n";
+      echo "<div class=\"sortable\">\n";
     }
 
     foreach ($orders as $order) {
       $contact = get_contact_by_id($order->getBeneficiaryId());
       if (! $contact) continue;
 
-      echo "<span>\n";
+      echo "<div>";
 
       $phones = array();
       $area = get_contact_area($contact);
       }
 
       echo "<hr>\n";
-      echo "</span>\n\n";
+      echo "</div>\n\n";
     }
 
     if ($count > 1) echo "</div>\n";
index a2432d3..7c9cc08 100644 (file)
@@ -2,9 +2,9 @@
 <link rel="stylesheet" type="text/css" href="/style.css">
 <title><?php echo "$charity"; if ($module) echo " - $module"; ?></title>
 <?php
-  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css\">\n";
-  echo "<script src=\"$http://code.jquery.com/jquery-1.9.1.js\"></script>\n";
-  echo "<script src=\"$http://code.jquery.com/ui/1.10.3/jquery-ui.js\"></script>\n";
+  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$http://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css\">\n";
+  echo "<script src=\"$http://code.jquery.com/jquery-1.12.4.js\"></script>\n";
+  echo "<script src=\"$http://code.jquery.com/ui/1.12.1/jquery-ui.js\"></script>\n";
 ?>
 <script src="/jquery.autosize.js"></script>
 <script src="/jquery.sortable.js"></script>
index 3e59fe6..6395b52 100644 (file)
@@ -1,7 +1,7 @@
 $(function() {
  $(".sortable").sortable({
    axis: "y",
-   containment: "parent",
+   containment: "document",
    placeholder: "sortplaceholder",
    forcePlaceholderSize: true,
    start: function( event, ui ) { ui.item.addClass('sortdragging'); },
index 96c3cda..bda32bf 100644 (file)
@@ -116,6 +116,7 @@ table.report > * > tr > td {
   border-radius: 0.5em;
   padding-bottom: 1em;
   background: #eeeeee;
+  opacity: 0.75;
 }
 
 span.sortdragging hr {