Subversion Repository Public Repository

Nextrek

Diff Revisions 1128 vs 1129 for /socketIO/public/js/ui.js

Diff revisions: vs.
  @@ -51,6 +51,8 @@
51 51 function uiDisplayMessage(data) {
52 52 const $room = $(`#${data.room}`);
53 53 if ($room) {
54 - $room.find('ul').append($(`<li class="${data.from.role.toLowerCase()}" />`).html(`<small>${data.from.name}</small><br>${data.content}`));
54 + const $ul = $room.find('ul');
55 + $ul.append($(`<li class="${data.from.role.toLowerCase()}" />`).html(`<small>${data.from.name}</small><br>${data.content}`));
56 + $ul.scrollTop($ul.scrollTop() + $ul.innerHeight());
55 57 }
56 58 }