hardlounge/client/js/socket-events/nick.js
2017-06-20 07:22:58 +01:00

16 lines
371 B
JavaScript

"use strict";
const $ = require("jquery");
const socket = require("../socket");
const utils = require("../utils");
const sidebar = $("#sidebar");
socket.on("nick", function(data) {
const id = data.network;
const nick = data.nick;
const network = sidebar.find("#network-" + id).data("nick", nick);
if (network.find(".active").length) {
utils.setNick(nick);
}
});