summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAdam Wagner <wbadam@users.noreply.github.com>2017-06-07 14:50:38 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-06-07 14:50:38 +0300
commit8ff23ad10859132e5015f6372e623ed7ce8e05cc (patch)
tree92874f7b52ede7ac54526d8f3c40e5d4da825e69 /client
parent3b3c647e5b732a7e9e6109193a11e665270ffe2f (diff)
downloadvaadin-framework-8ff23ad10859132e5015f6372e623ed7ce8e05cc.tar.gz
vaadin-framework-8ff23ad10859132e5015f6372e623ed7ce8e05cc.zip
Add mouse event details to the drop event (#9485)
Fixes #9483
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java7
-rw-r--r--client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java10
2 files changed, 15 insertions, 2 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java
index 33729afe77..5b409e3174 100644
--- a/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java
+++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java
@@ -23,12 +23,14 @@ import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.TableRowElement;
import com.google.gwt.user.client.Window;
+import com.vaadin.client.MouseEventDetailsBuilder;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.WidgetUtil;
import com.vaadin.client.extensions.DropTargetExtensionConnector;
import com.vaadin.client.widget.escalator.RowContainer;
import com.vaadin.client.widget.escalator.RowContainer.BodyRowContainer;
import com.vaadin.client.widgets.Escalator;
+import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.grid.DropLocation;
import com.vaadin.shared.ui.grid.DropMode;
@@ -115,8 +117,11 @@ public class GridDropTargetConnector extends DropTargetExtensionConnector {
dropLocation = DropLocation.EMPTY;
}
+ MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder
+ .buildMouseEventDetails(dropEvent, targetElement);
+
getRpcProxy(GridDropTargetRpc.class).drop(types, data, dropEffect,
- rowKey, dropLocation);
+ rowKey, dropLocation, mouseEventDetails);
}
private JsonObject getRowData(TableRowElement row) {
diff --git a/client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java b/client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java
index cd7cc7026b..7e64b0d305 100644
--- a/client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java
+++ b/client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java
@@ -26,8 +26,10 @@ import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.BrowserInfo;
+import com.vaadin.client.MouseEventDetailsBuilder;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.ui.AbstractComponentConnector;
+import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.dnd.DropEffect;
import com.vaadin.shared.ui.dnd.DropTargetRpc;
@@ -362,7 +364,13 @@ public class DropTargetExtensionConnector extends AbstractExtensionConnector {
protected void sendDropEventToServer(List<String> types,
Map<String, String> data, String dropEffect,
NativeEvent dropEvent) {
- getRpcProxy(DropTargetRpc.class).drop(types, data, dropEffect);
+ // Build mouse event details for the drop event
+ MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder
+ .buildMouseEventDetails(dropEvent, getDropTargetElement());
+
+ // Send data to server with RPC
+ getRpcProxy(DropTargetRpc.class)
+ .drop(types, data, dropEffect, mouseEventDetails);
}
/**