diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-10-29 11:03:58 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-10-29 11:05:05 +0000 |
commit | 2a44558fbd719fc6d0beb13e658c28e534e36cdb (patch) | |
tree | ff4349435bd27d973d2e03124c3daa7f51b96a7d | |
parent | fix mobile CSS layout (diff) | |
download | synapse-2a44558fbd719fc6d0beb13e658c28e534e36cdb.tar.xz |
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.
-rw-r--r-- | webclient/room/room-controller.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 78520a829d..31aed71d7f 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -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. // Exception: in case where the event is from the user, we want to force scroll to the bottom 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() { objDiv.scrollTop = objDiv.scrollHeight; |