2017-05-18 20:08:54 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const $ = require("jquery");
|
|
|
|
const socket = require("../socket");
|
|
|
|
const sidebar = $("#sidebar");
|
|
|
|
|
|
|
|
socket.on("part", function(data) {
|
|
|
|
const chanMenuItem = sidebar.find(".chan[data-id='" + data.chan + "']");
|
|
|
|
|
|
|
|
// When parting from the active channel/query, jump to the network's lobby
|
|
|
|
if (chanMenuItem.hasClass("active")) {
|
2018-01-30 09:38:33 +00:00
|
|
|
chanMenuItem
|
|
|
|
.parent(".network")
|
|
|
|
.find(".lobby")
|
|
|
|
.trigger("click");
|
2017-05-18 20:08:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
chanMenuItem.remove();
|
|
|
|
$("#chan-" + data.chan).remove();
|
|
|
|
});
|