Permalink
Browse files

chat scroll

  • Loading branch information...
1 parent c4d3825 commit c1f3ed79fcb814475f38d5d6b42d5ff7103e79ff @mick committed Apr 4, 2012
Showing with 6 additions and 1 deletion.
  1. +5 −0 web/static/client.js
  2. +1 −1 web/static/style.css
View
@@ -132,8 +132,12 @@ var talkback = {
var message = $msg.find("body").text();
var $messagebox = $("<div class='messagebox'><span class='username'>"+from+":</span> "+message+"</div>");
$("#chatcontent").append($messagebox);
+ talkback.roomScroll();
return true;
},
+ roomScroll:function(){
+ $("#chatcontent").scrollTop($("#chatcontent").height());
+ },
roomPresence:function(msg){
console.log("roster: ", talkback.roster);
if(talkback.roster[$(msg).attr("from")] !== undefined){
@@ -146,6 +150,7 @@ var talkback = {
var from = $(msg).attr("from").replace(talkback.roomjid+"/","");
var $messagebox = $("<div class='messagebox joined'>"+from+" joined</div>");
$("#chatcontent").append($messagebox);
+ talkback.roomScroll();
talkback.roster[$(msg).attr("from")] = $(msg).attr("from");
}
//connection.vcard.get(talkback.vcardHandler, $(msg).attr("from"));
View
@@ -1,5 +1,5 @@
body{ margin:0px; padding:0px; font-family:arial; font-size:14px;}
-div#chatcontent{ position: absolute; top:0px; right:0px; bottom:50px; top:38px; background:#fff; width:250px;}
+div#chatcontent{ position: absolute; top:0px; right:0px; bottom:110px; top:38px; background:#fff; width:250px; overflow:auto;}
div#headerwrapper{ position:absolute; top:0px; left:0px;
z-index:10; width:100%;

0 comments on commit c1f3ed7

Please sign in to comment.