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

View File

@ -1,5 +1,5 @@
{{#each networks}} {{#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"}} {{partial "chan"}}
</section> </section>
{{/each}} {{/each}}