mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Fix SYWEB-128 : Auto-scroll broken if not exactly at bottom of list.
Added a small 10px buffer so if the list isn't quite at the bottom it still actually scrolls.
This commit is contained in:
parent
51b81b472d
commit
2a44558fbd
@ -133,7 +133,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
|
|||||||
// Do not autoscroll to the bottom to display the new event if the user is not at the bottom.
|
// Do not autoscroll to the bottom to display the new event if the user is not at the bottom.
|
||||||
// Exception: in case where the event is from the user, we want to force scroll to the bottom
|
// Exception: in case where the event is from the user, we want to force scroll to the bottom
|
||||||
var objDiv = document.getElementById("messageTableWrapper");
|
var objDiv = document.getElementById("messageTableWrapper");
|
||||||
if ((objDiv.offsetHeight + objDiv.scrollTop >= objDiv.scrollHeight) || force) {
|
// add a 10px buffer to this check so if the message list is not *quite*
|
||||||
|
// at the bottom it still scrolls since it basically is at the bottom.
|
||||||
|
if ((10 + objDiv.offsetHeight + objDiv.scrollTop >= objDiv.scrollHeight) || force) {
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
objDiv.scrollTop = objDiv.scrollHeight;
|
objDiv.scrollTop = objDiv.scrollHeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user