mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-01-13 01:38:19 +01:00
Add a debounce delay to allow mobile to bouble tap.
This commit is contained in:
parent
cf2408013e
commit
55049ba9d2
@ -828,12 +828,17 @@ function createTask(task) {
|
|||||||
</div>`
|
</div>`
|
||||||
|
|
||||||
createCollapsibles(taskEntry)
|
createCollapsibles(taskEntry)
|
||||||
|
|
||||||
let draghandle = taskEntry.querySelector('.drag-handle')
|
let draghandle = taskEntry.querySelector('.drag-handle')
|
||||||
draghandle.addEventListener('mousedown', (e) => { taskEntry.setAttribute('draggable',true)})
|
draghandle.addEventListener('mousedown', (e) => {
|
||||||
draghandle.addEventListener('mouseup', (e) => { taskEntry.setAttribute('draggable',false)})
|
taskEntry.setAttribute('draggable', true)
|
||||||
taskEntry.addEventListener('dragend', (e) => {
|
})
|
||||||
taskEntry.setAttribute('draggable',false);
|
// Add a debounce delay to allow mobile to bouble tap.
|
||||||
|
draghandle.addEventListener('mouseup', debounce((e) => {
|
||||||
|
taskEntry.setAttribute('draggable', false)
|
||||||
|
}, 2000))
|
||||||
|
taskEntry.addEventListener('dragend', (e) => {
|
||||||
|
taskEntry.setAttribute('draggable', false);
|
||||||
imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => {
|
imagePreview.querySelectorAll(".imageTaskContainer").forEach(itc => {
|
||||||
itc.classList.remove('dropTargetBefore','dropTargetAfter');
|
itc.classList.remove('dropTargetBefore','dropTargetAfter');
|
||||||
});
|
});
|
||||||
@ -846,7 +851,6 @@ function createTask(task) {
|
|||||||
startY = e.target.closest(".imageTaskContainer").offsetTop;
|
startY = e.target.closest(".imageTaskContainer").offsetTop;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
if (task.reqBody.init_image !== undefined) {
|
if (task.reqBody.init_image !== undefined) {
|
||||||
createInitImageHover(taskEntry)
|
createInitImageHover(taskEntry)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user