mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 05:50:22 +00:00
Better window handling when closing
This commit is contained in:
parent
7e0b11ebf2
commit
0757450859
1 changed files with 17 additions and 3 deletions
|
@ -128,9 +128,23 @@ $(function() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "part":
|
case "part":
|
||||||
$("#channel-" + data.id)
|
var chan = $("#channel-" + data.id).add("#window-" + data.id).remove();
|
||||||
.add("#window-" + data.id)
|
if (!chan.hasClass("active")) {
|
||||||
.remove();
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var next = null;
|
||||||
|
var z = 0;
|
||||||
|
$("#main .window").each(function() {
|
||||||
|
var index = parseInt($(this).css("zIndex"));
|
||||||
|
if (index > z) {
|
||||||
|
z = index;
|
||||||
|
next = this;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (typeof next !== "undefined") {
|
||||||
|
$("#channel-" + $(next).data("id")).trigger("click");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "users":
|
case "users":
|
||||||
|
|
Loading…
Reference in a new issue