Automatically scroll to the last message
This commit is contained in:
parent
3cbfd2709f
commit
bdf754c0d8
2 changed files with 16 additions and 0 deletions
8
app/assets/javascripts/new_design/messagerie.js
Normal file
8
app/assets/javascripts/new_design/messagerie.js
Normal 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);
|
|
@ -3,6 +3,14 @@
|
||||||
@import "constants";
|
@import "constants";
|
||||||
|
|
||||||
.messagerie {
|
.messagerie {
|
||||||
|
ul {
|
||||||
|
max-height: 350px;
|
||||||
|
overflow-y: scroll;
|
||||||
|
border: 1px solid $border-grey;
|
||||||
|
padding: 2 * $default-spacer;
|
||||||
|
margin-bottom: $default-spacer;
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
Loading…
Reference in a new issue