From 8ae5f25075ae196bfab0446d94c81aa7188a252f Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 6 Dec 2021 17:26:51 -0500 Subject: [PATCH] chat: Make sure the icon is visible when minimizing --- src/static/js/chat.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index acb471b39..789c5304f 100755 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -86,6 +86,16 @@ exports.chat = (() => { $('#options-stickychat').prop('checked', false); } else { $('#chatcounter').text('0'); + // It usually is not necessary to call .show() because .hide() is only normally called when + // the pad is loaded and showChat=false. When showChat=false, there are no chat UI elements + // so there's nothing to click on to get the chatbox to display. However, there are other + // ways to get the chatbox to display: + // * A plugin might call `chat.show()`. + // * The user can hit Alt-C (assuming the shortcut is enabled). + // * The user can run `chat.show()` in the developer console. + // In all cases, reducing the shown chatbox should cause it to minimize to an icon, not + // vanish completely. + $('#chaticon').show(); $('#chaticon').addClass('visible'); $('#chatbox').removeClass('visible'); }