chat is done?

This commit is contained in:
Lars van Hijfte
2017-01-18 15:09:52 +01:00
parent 19f525d168
commit 95fd3c0040
5 changed files with 84 additions and 34 deletions

View File

@@ -12,6 +12,7 @@ function loadMessages() {
messages = JSON.parse(data);
addMessages(messages);
$("#lastID").val(messages[messages.length - 1].messageID);
$("#chat-history").scrollTop($("#chat-history")[0].scrollHeight);
}
});
@@ -47,4 +48,10 @@ function addMessages(messages) {
</div>\
');
}
}
function switchUser(userID) {
$(".destinationID").val(userID);
$("#chat-history").html("");
$("#lastID").val("");
}

View File

@@ -16,6 +16,10 @@
overflow-y: auto;
}
.chat-left .friend-item {
cursor: pointer;
}
.chat-right {
width: calc(100% - 256px - 40px);
height: calc(100% - 80px);