summaryrefslogtreecommitdiffstats
path: root/webchat/public/client.js
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2013-11-07 13:35:53 +0100
committertv <tv@nomic.retiolum>2013-11-07 13:35:53 +0100
commitc06a92d72b62fe95fecd67719c605d4408c44838 (patch)
treedc48936ea051af41124827cb3218dbcc3ee00435 /webchat/public/client.js
parent712612634f53cc96be760a547bb13743f9ee77d0 (diff)
parenta8dcc8b3ce76916d3299956b64aa765cb8321482 (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'webchat/public/client.js')
-rw-r--r--webchat/public/client.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/webchat/public/client.js b/webchat/public/client.js
index e7179449..ca71b537 100644
--- a/webchat/public/client.js
+++ b/webchat/public/client.js
@@ -52,8 +52,11 @@ $(function connect() {
console.log(object.message);
var safe_message = $('<div/>').text(object.message).html();
safe_message = replaceURLWithHTMLLinks(safe_message);
- var safe_from = $('<div/>').text(object.from).html();
- $('<tr><td class="chat_date">'+getCurTime()+'</td><td class="chat_from">'+safe_from+'</td><td class="chat_msg">'+safe_message+'</td></tr>').insertBefore('#foot');
+ var safe_from = $('<div/>').text(object.from).html();
+ $('<tr><td class="chat_date">'+getCurTime()+'</td><td class="chat_from">'+safe_from+'</td><td class="chat_msg">'+safe_message+'</td></tr>').insertBefore('#foot');
+
+ var elem = document.getElementById('chatter');
+ elem.scrollTop = elem.scrollHeight;
} catch (error) {
console.log(error);