Implement a workaround to get scroll to bottom working again

with-route-provider
Tor Hveem 12 years ago
parent cb4f811a12
commit f666c0c9fe
  1. 9
      js/websockets.js

@ -441,9 +441,12 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}); });
$rootScope.scrollToBottom = function() { $rootScope.scrollToBottom = function() {
$timeout(function(){ // FIXME doesn't work if the settimeout runs without a short delay
window.scrollTo(0, window.scrollMaxY-1); // 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() { $scope.sendMessage = function() {

Loading…
Cancel
Save