Remove channel containers from DOM after quitting network
This commit is contained in:
parent
0cc9c4166b
commit
99c8e1c04a
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user