From 99de80ae526d507d1fb0f90a27d1e401f3f76850 Mon Sep 17 00:00:00 2001 From: Denis Anisimov Date: Sun, 16 Mar 2014 22:10:43 +0200 Subject: Bring window to front on window header click (#13445). Change-Id: I3322dcff0199125f49cc48afdc467516b420e845 --- client/src/com/vaadin/client/ui/VWindow.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'client/src/com') diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index 6a908aaa29..396fc76eb0 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -991,14 +991,14 @@ public class VWindow extends VWindowOverlay implements } bubble = false; } + if (type == Event.ONCLICK) { + activateOnClick(); + } } else if (dragging || !contents.isOrHasChild(target)) { onDragEvent(event); bubble = false; } else if (type == Event.ONCLICK) { - // clicked inside window, ensure to be on top - if (!isActive()) { - bringToFront(); - } + activateOnClick(); } /* @@ -1020,6 +1020,13 @@ public class VWindow extends VWindowOverlay implements } } + private void activateOnClick() { + // clicked inside window or inside header, ensure to be on top + if (!isActive()) { + bringToFront(); + } + } + private void onCloseClick() { client.updateVariable(id, "close", true, true); } -- cgit v1.2.3