From 5e7a6cfef710c279e6a0ff0ea3654b37044d840c Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 15 Sep 2022 12:40:49 +0200 Subject: [PATCH] Fix mail tree drop hover class sometimes not being removed from hovered once nodes --- api/js/egw_action/egw_action_dragdrop.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/js/egw_action/egw_action_dragdrop.js b/api/js/egw_action/egw_action_dragdrop.js index 402036c9b6..3306e5a5f1 100644 --- a/api/js/egw_action/egw_action_dragdrop.js +++ b/api/js/egw_action/egw_action_dragdrop.js @@ -461,7 +461,7 @@ export function egwDropActionImplementation() } if (!self.getTheDraggedDOM()) return ; - const data = { + const data = { event: event, ui: self.getTheDraggedData() }; @@ -487,6 +487,9 @@ export function egwDropActionImplementation() _aoi.triggerEvent(EGW_AI_DRAG_ENTER, data); + // cleanup drop hover class from all other DOMs if there's still anything left + Array.from(document.getElementsByClassName('et2dropzone drop-hover')).forEach(_i=>{_i.classList.remove('drop-hover')}) + this.classList.add('drop-hover'); // stop the event from being fired for its children