mirror of
https://github.com/thelounge/thelounge
synced 2024-11-27 06:20:26 +00:00
73755ce973
Added in 04046719c1
, but it's not necessary
26 lines
517 B
JavaScript
26 lines
517 B
JavaScript
"use strict";
|
|
|
|
const $ = require("jquery");
|
|
const chat = $("#chat");
|
|
const socket = require("../socket");
|
|
const sidebar = $("#sidebar");
|
|
|
|
socket.on("quit", function(data) {
|
|
const id = data.network;
|
|
const network = sidebar.find(`#network-${id}`);
|
|
|
|
network.children(".chan").each(function() {
|
|
// this = child
|
|
chat.find($(this).data("target")).remove();
|
|
});
|
|
|
|
network.remove();
|
|
|
|
const chan = sidebar.find(".chan")
|
|
.eq(0)
|
|
.trigger("click");
|
|
|
|
if (chan.length === 0) {
|
|
sidebar.find(".empty").show();
|
|
}
|
|
});
|