From 5b3ae6d62e5ff49ef0b204ed27b1004399a19aac Mon Sep 17 00:00:00 2001 From: Juho Nurminen Date: Thu, 20 Mar 2014 16:16:41 +0200 Subject: Made Window z-indices update when windows are closed (#13174) Change-Id: I2fa7566ec4788893d1d99440a7ca2d014c9a8f13 --- client/src/com/vaadin/client/ui/VWindow.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index f83bc83c8d..6afb6c2d8a 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -487,9 +487,14 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } super.hide(); + int curIndex = windowOrder.indexOf(this); // Remove window from windowOrder to avoid references being left // hanging. - windowOrder.remove(this); + windowOrder.remove(curIndex); + // Update the z-indices of any remaining windows + while (curIndex < windowOrder.size()) { + windowOrder.get(curIndex).setWindowOrder(curIndex++); + } } private void fixIE8FocusCaptureIssue() { -- cgit v1.2.3