From a392b9f35f51278f2876242880627170f5bc1622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 24 Dec 2017 19:17:26 -0500 Subject: [PATCH] Improve a bit window loading on init --- client/js/socket-events/init.js | 3 +-- client/views/chat.tpl | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/js/socket-events/init.js b/client/js/socket-events/init.js index 621984cd..f2cd9fc1 100644 --- a/client/js/socket-events/init.js +++ b/client/js/socket-events/init.js @@ -64,8 +64,7 @@ function openCorrectChannel(clientActive, serverActive) { // Open window provided in location.hash if (target.length === 0 && window.location.hash) { - target = $("#footer, #sidebar, #help") - .find(`[data-target="${escape(window.location.hash)}"]`); + target = $(`[data-target="${escape(window.location.hash)}"]`).first(); } // Open last active channel according to the server diff --git a/client/views/chat.tpl b/client/views/chat.tpl index b5b32d30..16d287bb 100644 --- a/client/views/chat.tpl +++ b/client/views/chat.tpl @@ -1,5 +1,11 @@ {{#each channels}} -
+
{{#equal type "channel"}}