Merge pull request #1607 from PolarizedIons/PolarizedIons/rm-channels-dom

Remove channel containers from DOM after quitting network
This commit is contained in:
Pavel Djundik 2017-10-17 11:31:17 +03:00 committed by GitHub
commit afc594a655

View File

@ -1,12 +1,20 @@
"use strict"; "use strict";
const $ = require("jquery"); const $ = require("jquery");
const chat = $("#chat");
const socket = require("../socket"); const socket = require("../socket");
const sidebar = $("#sidebar"); const sidebar = $("#sidebar");
socket.on("quit", function(data) { socket.on("quit", function(data) {
const id = data.network; const id = data.network;
sidebar.find("#network-" + id).remove(); 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") const chan = sidebar.find(".chan")
.eq(0) .eq(0)