From e799cc493c7071e2ad1fa1c6d0a316f361925f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 10 Apr 2016 01:03:08 -0400 Subject: [PATCH] Move the sidebar serverOptions to the according template --- client/js/libs/handlebars/tojson.js | 7 +++++++ client/js/lounge.js | 2 -- client/views/network.tpl | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 client/js/libs/handlebars/tojson.js diff --git a/client/js/libs/handlebars/tojson.js b/client/js/libs/handlebars/tojson.js new file mode 100644 index 00000000..7df32f77 --- /dev/null +++ b/client/js/libs/handlebars/tojson.js @@ -0,0 +1,7 @@ +"use strict"; + +Handlebars.registerHelper( + "toJSON", function(context) { + return JSON.stringify(context); + } +); diff --git a/client/js/lounge.js b/client/js/lounge.js index 8ecfa8fd..eaa4f3dc 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -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 diff --git a/client/views/network.tpl b/client/views/network.tpl index feec605d..c10162a0 100644 --- a/client/views/network.tpl +++ b/client/views/network.tpl @@ -1,5 +1,5 @@ {{#each networks}} -
+
{{partial "chan"}}
{{/each}}