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 1/2] 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"}} From d16b18de786b28ac24ae41aa27fa22e7bfa54436 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 26 Dec 2017 20:40:02 +0200 Subject: [PATCH 2/2] Open context menu inside of chats on sidebar item --- client/js/lounge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/lounge.js b/client/js/lounge.js index 7fdb4f5c..07f7c5ce 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -174,7 +174,7 @@ $(function() { }); viewport.on("click", "#chat .menu", function(e) { - e.currentTarget = $(e.currentTarget).closest(".chan")[0]; + e.currentTarget = $(`#sidebar .chan[data-id="${$(this).closest(".chan").data("id")}"]`)[0]; return showContextMenu(this, e); });