diff --git a/ReallifeGamemode.Client/assets/js/chat/main.js b/ReallifeGamemode.Client/assets/js/chat/main.js index 50619991..f9ebd0aa 100644 --- a/ReallifeGamemode.Client/assets/js/chat/main.js +++ b/ReallifeGamemode.Client/assets/js/chat/main.js @@ -23,7 +23,8 @@ function enableChatInput(enable) { if (enable) { chat.input = $("#chat").append('
').children(":last"); chat.input.children("input").focus(); - } else { + } + else { chat.input.fadeOut('fast', function () { chat.input.remove(); chat.input = null; @@ -64,14 +65,12 @@ var chatAPI = var today = new Date(); if (chatElement === "
  • ") { - var time = today.toLocaleTimeString('de-DE'); - chat.container.append("
  • " + "[" + time + "] " + text + "
  • "); - if (chat.input == null || elmnt.scrollTop == elmnt.scrollHeight - elmnt.clientHeight) { + chat.container.append("
  • " + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "
  • "); elmnt.scrollTop = elmnt.scrollHeight - elmnt.clientHeight; + } else { + chat.container.append("
  • " + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "
  • "); } - - // if (!chat.enabled) { elmnt.scrollTo(0, elmnt.scrollHeight); } } else { chat.container.append(chatElement); }