Move the sidebar serverOptions to the according template

This commit is contained in:
Jérémie Astori 2016-04-10 01:03:08 -04:00
parent 34af38ff92
commit e799cc493c
3 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,7 @@
"use strict";
Handlebars.registerHelper(
"toJSON", function(context) {
return JSON.stringify(context);
}
);

View file

@ -146,7 +146,6 @@ $(function() {
})
);
var channels = $.map(data.networks, function(n) {
sidebar.find("#network-" + n.id).data("options", n.serverOptions);
return n.channels;
});
chat.html(
@ -296,7 +295,6 @@ $(function() {
networks: [data.network]
})
);
sidebar.find("#network-" + data.network.id).data("options", data.network.serverOptions);
chat.append(
render("chat", {
channels: data.network.channels

View file

@ -1,5 +1,5 @@
{{#each networks}}
<section id="network-{{id}}" class="network" data-id="{{id}}" data-nick="{{nick}}">
<section id="network-{{id}}" class="network" data-id="{{id}}" data-nick="{{nick}}" data-options="{{toJSON serverOptions}}">
{{partial "chan"}}
</section>
{{/each}}