adding delay of 2sec to expand folder on DragDrop

-- regarding Ticket: 91581
This commit is contained in:
milan 2024-02-21 09:36:56 +01:00
parent 1c608ac6a5
commit d1e8a702c0

View File

@ -22,6 +22,9 @@ function dhtmlxTree_getNode(_tree: Et2Tree, _itemId: string)
return node
}
}
export const EXPAND_FOLDER_ON_DRAG_DROP_TIMEOUT = 2000
export class EgwDragDropShoelaceTree {
constructor(_tree:Et2Tree, _itemId) {
@ -36,8 +39,12 @@ export class EgwDragDropShoelaceTree {
if (_event == EGW_AI_DRAG_OVER)
{
this.node.classList.add("draggedOver");
this.node.expanded = true
setTimeout(() => {
if (this.node.classList.contains("draggedOver"))
{
this.node.expanded = true
}
}, EXPAND_FOLDER_ON_DRAG_DROP_TIMEOUT)
}
if (_event == EGW_AI_DRAG_OUT)
{