Bugfixes
This commit is contained in:
parent
d49ee1326b
commit
a458ad24b3
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue