diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-04-13 11:47:45 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-04-13 11:47:45 +0300 |
commit | dd1d288d5fe7b3a1ee3db93afccacae72bc7408c (patch) | |
tree | 27231f5752e0840e6838a2e1885249bac9b6dd56 /client | |
parent | 8cf7b41e3f3dddb0a83cbc422511adb24796f85d (diff) | |
download | vaadin-framework-dd1d288d5fe7b3a1ee3db93afccacae72bc7408c.tar.gz vaadin-framework-dd1d288d5fe7b3a1ee3db93afccacae72bc7408c.zip |
Create combined drop mode to allow both on_top and between drops (#9063)
Resolves #8932
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java | 9 |
1 files changed, 9 insertions, 0 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 13767763f8..7814a81208 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 @@ -117,6 +117,15 @@ public class GridDropTargetConnector extends } else { return DropLocation.BELOW; } + } else if (getState().dropMode == DropMode.ON_TOP_OR_BETWEEN) { + if (getRelativeY(target, event) < getState().dropThreshold) { + return DropLocation.ABOVE; + } else if (target.getOffsetHeight() - getRelativeY(target, event) + < getState().dropThreshold) { + return DropLocation.BELOW; + } else { + return DropLocation.ON_TOP; + } } return DropLocation.ON_TOP; } |