Merge pull request #2225 from thelounge/mcinkay/2224-collapse-select-lobby

Select lobby of network when collapsing network
This commit is contained in:
Jérémie Astori 2018-03-16 21:49:16 -04:00 committed by GitHub
commit 4c62b0d50c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -308,6 +308,10 @@ function loadMoreHistory(entries) {
sidebar.on("click", ".collapse-network", (e) => { sidebar.on("click", ".collapse-network", (e) => {
const collapseButton = $(e.target); const collapseButton = $(e.target);
if (collapseButton.closest(".network").find(".active").length > 0) {
collapseButton.closest(".lobby").click();
}
collapseButton.closest(".network").toggleClass("collapsed"); collapseButton.closest(".network").toggleClass("collapsed");
if (collapseButton.attr("aria-expanded") === "true") { if (collapseButton.attr("aria-expanded") === "true") {