diff --git a/js/websockets.js b/js/websockets.js index a02962e..d5578f7 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -342,14 +342,16 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $rootScope.scrollToBottom = function() { // 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() { + var scroll = function() { var readmarker = document.getElementById('readmarker'); if(readmarker) { readmarker.scrollIntoView(); }else{ window.scroll(0, document.documentElement.scrollHeight - document.documentElement.clientHeight); } - }, 300); + } + scroll(); + $timeout(scroll, 300); } $scope.sendMessage = function() {