From 0c20e29c41bf3dbe648d6612b8b6cdf5c1d216d4 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Mon, 14 Apr 2014 14:54:17 +0200 Subject: [PATCH] Fix active window after closing --- client/js/chat.js | 12 ++++++++++++ client/js/lib/jquery-scroll-glue | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/client/js/chat.js b/client/js/chat.js index ba6e4ed..6b2a5b2 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -85,6 +85,18 @@ $(function() { var id = json.data.id; if (json.action == "remove") { $("#channel-" + id + ", #window-" + id).remove(); + var highest = 0; + var next = null; + $(".window").each(function() { + var z = $(this).css("z-index"); + if (z > highest) { + highest = z; + next = $(this); + } + }); + if (next != null) { + next.addClass("active"); + } return; } diff --git a/client/js/lib/jquery-scroll-glue b/client/js/lib/jquery-scroll-glue index e5178ce..e4ceb5e 160000 --- a/client/js/lib/jquery-scroll-glue +++ b/client/js/lib/jquery-scroll-glue @@ -1 +1 @@ -Subproject commit e5178ce29594a11c3fdb453de35a167f0a49619b +Subproject commit e4ceb5e03529fd5d56d0e4077dd424ad64c13336