diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 789c5304f..164b5da98 100755 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -100,6 +100,14 @@ exports.chat = (() => { $('#chatbox').removeClass('visible'); } }, + minimize() { + if ($('#options-stickychat').prop('checked')) this.reduce(); + this.reduce(); + }, + hide() { + this.minimize(); + $('#chaticon').hide(); + }, scrollDown(force) { if ($('#chatbox').hasClass('visible')) { if (force || !this.lastMessage || !this.lastMessage.position() || diff --git a/src/static/js/pad.js b/src/static/js/pad.js index d6cebdd90..0d619b6f1 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -76,8 +76,7 @@ const getParameters = [ callback: (val) => { if (val === 'false') { settings.hideChat = true; - chat.reduce(); - $('#chaticon').hide(); + chat.hide(); } }, }, @@ -480,10 +479,9 @@ const pad = { } if (window.clientVars.readonly) { - chat.reduce(); + chat.hide(); $('#myusernameedit').attr('disabled', true); $('#chatinput').attr('disabled', true); - $('#chaticon').hide(); $('#options-chatandusers').parent().hide(); $('#options-stickychat').parent().hide(); } else if (!settings.hideChat) { $('#chaticon').show(); }