mirror of
https://github.com/thelounge/thelounge
synced 2024-11-27 06:20:26 +00:00
18 lines
464 B
JavaScript
18 lines
464 B
JavaScript
|
"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")) {
|
||
|
chanMenuItem.parent(".network").find(".lobby").click();
|
||
|
}
|
||
|
|
||
|
chanMenuItem.remove();
|
||
|
$("#chan-" + data.chan).remove();
|
||
|
});
|