diff options
author | Anna Koskinen <anna@vaadin.com> | 2016-05-09 12:08:39 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-05-09 10:25:09 +0000 |
commit | e5765f1e53b47354b5d0910fe0c19c008734ba53 (patch) | |
tree | b3145c601e84473256664f6ebf519c5a3c6d8a41 | |
parent | 66debbb208059d8bc2c6f97388b30763680e30f9 (diff) | |
download | vaadin-framework-e5765f1e53b47354b5d0910fe0c19c008734ba53.tar.gz vaadin-framework-e5765f1e53b47354b5d0910fe0c19c008734ba53.zip |
Handle touch events in Window (#18042)
- fixes dragging not working from Window header
Change-Id: I9a35926abf43208c4bab0ae4b6dbc29bac17ba7b
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VWindow.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VWindow.java b/client/src/main/java/com/vaadin/client/ui/VWindow.java index f037d74f91..737af90b1f 100644 --- a/client/src/main/java/com/vaadin/client/ui/VWindow.java +++ b/client/src/main/java/com/vaadin/client/ui/VWindow.java @@ -989,7 +989,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } else if (header.isOrHasChild(target) && !dragging) { // dblclick handled in connector if (type != Event.ONDBLCLICK && draggable) { - if (type == Event.ONMOUSEDOWN) { + if (type == Event.ONMOUSEDOWN || type == Event.ONTOUCHSTART) { /** * Prevents accidental selection of window caption or * content. (#12726) @@ -997,7 +997,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, event.preventDefault(); headerDragPending = event; - } else if (type == Event.ONMOUSEMOVE + } else if ((type == Event.ONMOUSEMOVE || type == Event.ONTOUCHMOVE) && headerDragPending != null) { // ie won't work unless this is set here dragging = true; @@ -1023,7 +1023,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * If clicking on other than the content, move focus to the window. * After that this windows e.g. gets all keyboard shortcuts. */ - if (type == Event.ONMOUSEDOWN + if ((type == Event.ONMOUSEDOWN || type == Event.ONTOUCHSTART) && !contentPanel.getElement().isOrHasChild(target) && target != closeBox && target != maximizeRestoreBox) { contentPanel.focus(); |