From 0ac617eb154a1dc653bab54770003bb55b327483 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 23 May 2022 17:22:03 +0200 Subject: [PATCH] Add DRAG_ENTER event --- api/js/egw_action/egw_action_constants.js | 2 +- api/js/egw_action/egw_action_dragdrop.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/js/egw_action/egw_action_constants.js b/api/js/egw_action/egw_action_constants.js index 84e7963026..ac854124ed 100644 --- a/api/js/egw_action/egw_action_constants.js +++ b/api/js/egw_action/egw_action_constants.js @@ -24,7 +24,7 @@ export const EGW_AO_FLAG_DEFAULT_FOCUS = 0x02; export const EGW_AI_DRAG = 0x0100; // Use the first byte as mask for event types - 01 is for events used with drag stuff export const EGW_AI_DRAG_OUT = EGW_AI_DRAG | 0x01; export const EGW_AI_DRAG_OVER = EGW_AI_DRAG | 0x02; - +export const EGW_AI_DRAG_ENTER = EGW_AI_DRAG | 0x03; export const EGW_AO_EXEC_SELECTED = 0; export const EGW_AO_EXEC_THIS = 1; diff --git a/api/js/egw_action/egw_action_dragdrop.js b/api/js/egw_action/egw_action_dragdrop.js index ffbbda9476..a4f8f0ddf9 100644 --- a/api/js/egw_action/egw_action_dragdrop.js +++ b/api/js/egw_action/egw_action_dragdrop.js @@ -17,7 +17,7 @@ import {egwAction,egwActionImplementation, egw_getObjectManager} from "./egw_action.js"; import {getPopupImplementation} from "./egw_action_popup.js"; -import {EGW_AI_DRAG_OUT, EGW_AI_DRAG_OVER, EGW_AO_EXEC_THIS} from "./egw_action_constants.js"; +import {EGW_AI_DRAG_OUT, EGW_AI_DRAG_OVER, EGW_AO_EXEC_THIS, EGW_AI_DRAG_ENTER} from "./egw_action_constants.js"; /** * Register the drag and drop handlers @@ -479,6 +479,13 @@ export function egwDropActionImplementation() currentDropEl = event.currentTarget; event.dataTransfer.dropEffect = 'link'; + const data = { + event: event, + ui: self.getTheDraggedData() + }; + + _aoi.triggerEvent(EGW_AI_DRAG_ENTER, data); + this.classList.add('drop-hover'); // stop the event from being fired for its children