Move the sidebar serverOptions to the according template
This commit is contained in:
parent
34af38ff92
commit
e799cc493c
7
client/js/libs/handlebars/tojson.js
Normal file
7
client/js/libs/handlebars/tojson.js
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
Handlebars.registerHelper(
|
||||
"toJSON", function(context) {
|
||||
return JSON.stringify(context);
|
||||
}
|
||||
);
|
@ -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
|
||||
|
@ -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}}
|
||||
|
Loading…
Reference in New Issue
Block a user