Зажим Таска на ПК
в мобильной версии зажим таска на пк :)
This commit is contained in:
@@ -7,6 +7,9 @@
|
|||||||
@touchstart="handleTouchStart"
|
@touchstart="handleTouchStart"
|
||||||
@touchend="handleTouchEnd"
|
@touchend="handleTouchEnd"
|
||||||
@touchmove="handleTouchMove"
|
@touchmove="handleTouchMove"
|
||||||
|
@mousedown="handleMouseDown"
|
||||||
|
@mouseup="handleMouseUp"
|
||||||
|
@mouseleave="handleMouseLeave"
|
||||||
@contextmenu="handleContextMenu"
|
@contextmenu="handleContextMenu"
|
||||||
:class="{ dragging: isDragging, 'has-label-color': cardLabelColor, 'long-pressing': isLongPressing }"
|
:class="{ dragging: isDragging, 'has-label-color': cardLabelColor, 'long-pressing': isLongPressing }"
|
||||||
:style="cardLabelColor ? { '--label-bg': cardLabelColor } : {}"
|
:style="cardLabelColor ? { '--label-bg': cardLabelColor } : {}"
|
||||||
@@ -149,6 +152,40 @@ const handleContextMenu = (e) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mouse long-press для ПК в мобильном режиме (когда touch события недоступны)
|
||||||
|
const handleMouseDown = (e) => {
|
||||||
|
if (!isMobile.value) return
|
||||||
|
// Только левая кнопка мыши
|
||||||
|
if (e.button !== 0) return
|
||||||
|
|
||||||
|
longPressTimer = setTimeout(() => {
|
||||||
|
isLongPressing.value = true
|
||||||
|
// Эмитим запрос на перемещение
|
||||||
|
emit('move-request', {
|
||||||
|
cardId: props.card.id,
|
||||||
|
cardTitle: props.card.title,
|
||||||
|
columnId: props.columnId
|
||||||
|
})
|
||||||
|
isLongPressing.value = false
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleMouseUp = () => {
|
||||||
|
if (longPressTimer) {
|
||||||
|
clearTimeout(longPressTimer)
|
||||||
|
longPressTimer = null
|
||||||
|
}
|
||||||
|
isLongPressing.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleMouseLeave = () => {
|
||||||
|
if (longPressTimer) {
|
||||||
|
clearTimeout(longPressTimer)
|
||||||
|
longPressTimer = null
|
||||||
|
}
|
||||||
|
isLongPressing.value = false
|
||||||
|
}
|
||||||
|
|
||||||
const refreshIcons = () => {
|
const refreshIcons = () => {
|
||||||
if (window.lucide) {
|
if (window.lucide) {
|
||||||
window.lucide.createIcons()
|
window.lucide.createIcons()
|
||||||
|
|||||||
Reference in New Issue
Block a user