hardlounge/client/js/socket-events/quit.js

19 lines
350 B
JavaScript
Raw Normal View History

2017-05-18 20:08:54 +00:00
"use strict";
const $ = require("jquery");
const socket = require("../socket");
const sidebar = $("#sidebar");
socket.on("quit", function(data) {
const id = data.network;
2017-09-12 12:52:16 +00:00
sidebar.find("#network-" + id).remove();
2017-05-18 20:08:54 +00:00
const chan = sidebar.find(".chan")
.eq(0)
.trigger("click");
2017-09-12 12:52:16 +00:00
2017-05-18 20:08:54 +00:00
if (chan.length === 0) {
sidebar.find(".empty").show();
}
});