From 76c4913513c0d817fc0d046fce7de031303d6ffb Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Mon, 9 May 2016 12:08:39 +0300 Subject: [PATCH] Handle touch events in Window (#18042) - fixes dragging not working from Window header Change-Id: I1b325db908a2cf9c003ede144105f26d0846aa31 --- client/src/com/vaadin/client/ui/VWindow.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index f037d74f91..737af90b1f 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/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(); -- 2.39.5