From: Anna Koskinen Date: Mon, 9 May 2016 09:08:39 +0000 (+0300) Subject: Handle touch events in Window (#18042) X-Git-Tag: 7.6.6~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=76c4913513c0d817fc0d046fce7de031303d6ffb;p=vaadin-framework.git Handle touch events in Window (#18042) - fixes dragging not working from Window header Change-Id: I1b325db908a2cf9c003ede144105f26d0846aa31 --- 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();