From 1f2c5514d4bfc278db0620ab16def9a5d8ce2018 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Mon, 4 Feb 2013 14:02:52 +0100 Subject: [PATCH] make sure chat sticks to the bottom of the chat window to prevent moving when loading --- code/chat.js | 6 +++--- main.js | 4 ++-- style.css | 9 +++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/code/chat.js b/code/chat.js index 7a12b3f4..2d9bd24f 100644 --- a/code/chat.js +++ b/code/chat.js @@ -27,7 +27,7 @@ window.chat.clear = function() { window.chat._newFactionTimestamp = -1; window.chat._oldPublicTimestamp = -1; window.chat._newPublicTimestamp = -1; - $('#chatfaction, #chatpublic, #chatautomated').data('ignoreNextScroll', true).html(''); + $('#chatfaction, #chatpublic, #chatautomated').data('ignoreNextScroll', true).html('
'); } window.chat.clearIfRequired = function() { @@ -332,7 +332,7 @@ window.chat.renderAutomatedMsgsTo = function() { return val; }).join('\n'); - $('#chatautomated').html(msgs); + $('#chatautomated').html('
'+msgs+'
'); } @@ -382,7 +382,7 @@ window.chat.renderPlayerMsgsTo = function(isFaction, data, isOldMsgs, dupCheckAr prevTime = nowTime; }); - var addTo = isFaction ? $('#chatfaction') : $('#chatpublic'); + var addTo = isFaction ? $('#chatfaction > div') : $('#chatpublic > div'); // if there is a change of day between two requests, handle the // divider insertion here. diff --git a/main.js b/main.js index de13ca94..c85f10fd 100644 --- a/main.js +++ b/main.js @@ -50,8 +50,8 @@ document.getElementsByTagName('body')[0].innerHTML = '' + ' expandautomatedpublicfaction' + '' + '' + '' diff --git a/style.css b/style.css index 01a25276..a05be007 100644 --- a/style.css +++ b/style.css @@ -130,8 +130,17 @@ a:hover { height: -webkit-calc(100% - 4px); height: -moz-calc(100% - 4px); padding: 2px; + position:relative; } +/* make text stick to the bottom */ +#chat > div > div { + position: absolute; + bottom:0; + left:2px; +} + + #chat p { display: block; padding: 1px 2px;