Automatically scroll to the last message

This commit is contained in:
Mathieu Magnin 2017-09-08 16:54:25 +02:00
parent 3cbfd2709f
commit bdf754c0d8
2 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,8 @@
TPS.scrollMessagerie = function () {
var $ul = $(".messagerie ul").first();
if($ul.length) {
$ul.scrollTop($ul.prop('scrollHeight'));
}
};
document.addEventListener("turbolinks:load", TPS.scrollMessagerie);

View file

@ -3,6 +3,14 @@
@import "constants";
.messagerie {
ul {
max-height: 350px;
overflow-y: scroll;
border: 1px solid $border-grey;
padding: 2 * $default-spacer;
margin-bottom: $default-spacer;
}
li {
display: flex;
align-items: flex-start;