hardlounge/client/js/socket-events/quit.js
2017-09-12 15:52:16 +03:00

19 lines
350 B
JavaScript

"use strict";
const $ = require("jquery");
const socket = require("../socket");
const sidebar = $("#sidebar");
socket.on("quit", function(data) {
const id = data.network;
sidebar.find("#network-" + id).remove();
const chan = sidebar.find(".chan")
.eq(0)
.trigger("click");
if (chan.length === 0) {
sidebar.find(".empty").show();
}
});