From 378fd095eb3191baa1b5d2a08be7e0d9b4ac69e1 Mon Sep 17 00:00:00 2001 From: Filips Alpe Date: Tue, 5 Aug 2014 21:31:51 +0300 Subject: [PATCH] Leave the chat window within the screen On smaller screens, the top of the chat window can appear so high that it is outside the screen, this fixes that. --- public/src/modules/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 78d5b6c546..cc4fbb1f42 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -249,7 +249,7 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar, module.center = function(chatModal) { chatModal.css("left", Math.max(0, (($(window).width() - $(chatModal).outerWidth()) / 2) + $(window).scrollLeft()) + "px"); - chatModal.css("top", $(window).height() / 4 - $(chatModal).outerHeight() / 2); + chatModal.css("top", Math.max(0, $(window).height() / 4 - $(chatModal).outerHeight() / 2)); chatModal.css("zIndex", 2000); chatModal.find('#chat-message-input').focus(); return chatModal;