From f666c0c9fe315738dcf1b21ce94ae7bea8f0c9bd Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Fri, 11 Oct 2013 13:41:36 +0200 Subject: [PATCH] Implement a workaround to get scroll to bottom working again --- js/websockets.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/websockets.js b/js/websockets.js index 3a98523..a96d13b 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -441,9 +441,12 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', }); $rootScope.scrollToBottom = function() { - $timeout(function(){ - window.scrollTo(0, window.scrollMaxY-1); - }); + // FIXME doesn't work if the settimeout runs without a short delay + // 300 ms seems to do the trick but creates a noticable flickr + $timeout(function() { + // TODO in the future, implement scrolling to last read line + window.scrollTo(0, document.querySelector('.bufferline:last-child').offsetTop); + }, 300); } $scope.sendMessage = function() {