fix drag & drop settings mobile vs desktop

This commit is contained in:
Robin Scholtes 2023-08-02 19:01:03 +12:00
parent ede69a7a1a
commit 4ba31236e9
2 changed files with 7 additions and 4 deletions

View file

@ -2,5 +2,4 @@
- search-results dropdown
- can only drag an op to favourites 1 time
- stupid popovers on deleting favs for instance ( dont always close nicely )
- UI tests etc.

View file

@ -35,14 +35,18 @@ class RecipeWaiter {
initDragAndDrop() {
const recList = document.getElementById("rec-list");
let swapThreshold = this.app.isMobileView() ? 0.60 : 0.40;
let animation = this.app.isMobileView() ? 400 : 200;
let delay = this.app.isMobileView() ? 200 : 0;
// Recipe list
Sortable.create(recList, {
group: "recipe",
sort: true,
draggable: "c-ingredient-li",
swapThreshold: this.app.isMobileView ? 0.60 : 0.40,
animation: this.app.isMobileView() ? 400 : 0,
delay: this.app.isMobileView ? 200 : 0,
swapThreshold: swapThreshold,
animation: animation,
delay: delay,
filter: ".arg",
preventOnFilter: false,
setData: function(dataTransfer, dragEl) {