[#181] adjust Sortable recipe list for a nice mobile experience ('long' press before grab kicks in so you can still scroll normally ), add some visual feedback when sortable-chosen is set on a li, tweak the animations and threshold a bit for a nicer experience

This commit is contained in:
Robin Scholtes 2023-05-03 13:32:17 +12:00
parent 8bed81c5ee
commit f80284cb36
3 changed files with 9 additions and 6 deletions

View file

@ -33,13 +33,15 @@ class RecipeWaiter {
*/
initialiseOperationDragNDrop() {
const recList = document.getElementById("rec-list");
const isMobileView = window.innerWidth < this.app.breakpoint;
// Recipe list
Sortable.create(recList, {
group: "recipe",
sort: true,
animation: 0,
delay: 0,
swapThreshold: isMobileView ? 0.60 : 0.3,
animation: isMobileView ? 400 : 200,
delay: isMobileView ? 200 : 0,
filter: ".arg",
preventOnFilter: false,
setData: function(dataTransfer, dragEl) {