This commit is contained in:
Mattias Erming 2014-04-21 13:20:20 +02:00
parent d49ee1326b
commit a458ad24b3
2 changed files with 7 additions and 7 deletions

View File

@ -36,7 +36,7 @@ $(function() {
}
function handleEvent(event, json) {
var data = json.data;
var data = [].concat(json.data);
switch (event) {
case "network":
@ -68,7 +68,7 @@ $(function() {
break;
case "channel":
var id = data.id;
var id = data[0].id;
if (json.action == "remove") {
$("#channel-" + id + ", #window-" + id).remove();
var highest = 0;
@ -89,13 +89,13 @@ $(function() {
sidebar.find(".channel").removeClass("active");
$("#network-" + json.target).append(
render("#channels", {channels: [data]})
render("#channels", {channels: data})
).find(".channel")
.last()
.addClass("active");
chat.append(
render("#windows", {windows: [data]})
render("#windows", {windows: data})
).find(".window")
.last()
.find("input")
@ -123,7 +123,7 @@ $(function() {
target = target.parent().find(".active");
}
var msg = $(render("#messages", {messages: [data]}));
var msg = $(render("#messages", {messages: data}));
target = target.find(".messages");
target.append(msg);

View File

@ -70,7 +70,7 @@ function connect(params) {
client: client,
}, {silent: true});
networks.trigger("network", networks);
networks.trigger("network", {data: networks});
client.nick(params.nick);
client.user(params.nick, params.realname);
@ -208,7 +208,7 @@ function input(json) {
case "quit":
case "disconnect":
networks.remove(network);
networks.trigger("network", networks);
networks.trigger("network", {data: networks});
break;
}