Browse Source

Chat is now scrolling to bottom

:cactus:
Johand 9 years ago
parent
commit
a8a7ff398d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/client/client.js

+ 6 - 0
app/client/client.js

@@ -218,6 +218,12 @@ Template.dashboard.onCreated(function() {
 });
 
 Template.room.events({
+    "click #side-panel": function(e) { 
+        Meteor.setTimeout(function() {
+        var elem = document.getElementById('chat');
+        elem.scrollTop = elem.scrollHeight;;
+        }, 1);
+    },
     "click #submit": function() {
         Meteor.call("sendMessage", Session.get("type"), $("#chat-input").val(), function(err, res) {
             console.log(err, res);