17 lines
394 B
JavaScript
17 lines
394 B
JavaScript
import { scrollTo, scrollToBottom } from '@utils';
|
|
|
|
function scrollMessagerie() {
|
|
const ul = document.querySelector('.messagerie ul');
|
|
|
|
if (ul) {
|
|
const elementToScroll = document.querySelector('.date.highlighted');
|
|
|
|
if (elementToScroll) {
|
|
scrollTo(ul, elementToScroll);
|
|
} else {
|
|
scrollToBottom(ul);
|
|
}
|
|
}
|
|
}
|
|
|
|
addEventListener('ds:page:update', scrollMessagerie);
|