1 function moveMouseToCenterOfElement(element) {
2 var centerX = element.offsetLeft + element.offsetWidth / 2;
3 var centerY = element.offsetTop + element.offsetHeight / 2;
4 eventSender.mouseMoveTo(centerX, centerY);
7 function dragFilesOntoInput(input, files) {
8 eventSender.beginDragWithFiles(files);
9 moveMouseToCenterOfElement(input);
10 eventSender.mouseUp();
13 function dragFilesOntoElement(element, files) {
14 eventSender.beginDragWithFiles(files);
15 var centerX = element.offsetLeft + element.offsetWidth / 2;
16 var centerY = element.offsetTop + element.offsetHeight / 2;
17 eventSender.mouseMoveTo(centerX, centerY);
18 eventSender.mouseUp();