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.
This commit is contained in:
Filips Alpe
2014-08-05 21:31:51 +03:00
parent 95979d9d97
commit 378fd095eb

View File

@@ -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;