mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-04 04:19:49 +01:00
Fake the drop position when pasting
This commit is contained in:
parent
f0d4523de1
commit
8fab640449
@ -600,6 +600,22 @@ function egwPopupActionImplementation()
|
|||||||
var add_action = mgr.getActionById('egw_copy_add');
|
var add_action = mgr.getActionById('egw_copy_add');
|
||||||
var paste_action = mgr.getActionById('egw_paste');
|
var paste_action = mgr.getActionById('egw_paste');
|
||||||
|
|
||||||
|
// Fake UI so we can simulate the position of the drop
|
||||||
|
if(window.event)
|
||||||
|
{
|
||||||
|
var event = jQuery.Event(window.event);
|
||||||
|
var ui = {
|
||||||
|
position: {top: 0, left: 0},
|
||||||
|
offset: {top: 0, left: 0}
|
||||||
|
};
|
||||||
|
if(event)
|
||||||
|
{
|
||||||
|
event = event.originalEvent;
|
||||||
|
ui.position = {top: event.pageY, left: event.pageX};
|
||||||
|
ui.offset = {top: event.offsetY, left: event.offsetX};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create default copy menu action
|
// Create default copy menu action
|
||||||
if(drag && !jQuery.isEmptyObject(drag))
|
if(drag && !jQuery.isEmptyObject(drag))
|
||||||
{
|
{
|
||||||
@ -695,6 +711,8 @@ function egwPopupActionImplementation()
|
|||||||
var paste_exec = function(action, selected) {
|
var paste_exec = function(action, selected) {
|
||||||
// Add in clipboard as a sender
|
// Add in clipboard as a sender
|
||||||
var clipboard = JSON.parse(egw.getSessionItem('phpgwapi', 'egw_clipboard'));
|
var clipboard = JSON.parse(egw.getSessionItem('phpgwapi', 'egw_clipboard'));
|
||||||
|
// Fake drop position
|
||||||
|
drop[action.id].actionObj.ui = ui;
|
||||||
drop[action.id].actionObj.execute(clipboard.selected,selected[0]);
|
drop[action.id].actionObj.execute(clipboard.selected,selected[0]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user