- Add flag to turn off auto-paste actions

- Turn off auto-paste actions when drop has multiple choices - paste is not valid during a real drop.
This commit is contained in:
Nathan Gray 2014-11-19 17:59:16 +00:00
parent 57f2e3c859
commit 103c0c73ad
2 changed files with 12 additions and 1 deletions

View File

@ -625,9 +625,15 @@ function egwDropActionImplementation()
// set of properties.
var popup = getPopupImplementation();
var pos = popup._getPageXY(event.originalEvent);
// Don't add paste actions, this is a drop
popup.auto_paste = false;
window.setTimeout(function() {
popup.doExecuteImplementation(pos, selected, links,
_context);
// Reset, popup is reused
popup.auto_paste = true;
}, 0); // Timeout is needed to have it working in IE
}

View File

@ -116,6 +116,8 @@ function egwPopupActionImplementation()
ai.type = "popup";
ai.auto_paste = true;
/**
* Registers the handler for the default action
*
@ -541,7 +543,10 @@ function egwPopupActionImplementation()
var tree = {"root": []};
// Automatically add in Drag & Drop actions
this._addCopyPaste(_links,_selected);
if(this.auto_paste)
{
this._addCopyPaste(_links,_selected);
}
for (var k in _links)
{